summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEudyptula <eitan@mosenkis.net>2009-08-14 11:42:02 -0400
committerEudyptula <eitan@mosenkis.net>2009-08-14 11:42:02 -0400
commit53eb7629d4cb33f62da5fe232bf2019e1a54d4f9 (patch)
tree4c40d2ef78dfd1564934612ee81df596ec3e350b /frontend
parentCreate sql_row_with_flags class, make user, build, configuration subclasses o... (diff)
downloadingenue-53eb7629d4cb33f62da5fe232bf2019e1a54d4f9.tar.gz
ingenue-53eb7629d4cb33f62da5fe232bf2019e1a54d4f9.tar.bz2
ingenue-53eb7629d4cb33f62da5fe232bf2019e1a54d4f9.zip
Quick hack to move bundler selection out of Gentoo module and make it a build-time option; drop 'failed' column from builds and use flags instead
Diffstat (limited to 'frontend')
-rw-r--r--frontend/modules/gentoo/step3.php10
-rw-r--r--frontend/pages/builds/delete.php2
-rw-r--r--frontend/pages/configurations/manager.php30
-rw-r--r--frontend/pages/configurations/wizard.php11
4 files changed, 37 insertions, 16 deletions
diff --git a/frontend/modules/gentoo/step3.php b/frontend/modules/gentoo/step3.php
index 83b101c..a270767 100644
--- a/frontend/modules/gentoo/step3.php
+++ b/frontend/modules/gentoo/step3.php
@@ -39,14 +39,4 @@ if ($this->get_opt('basesystem') == 'user_prune') {
}
$this->checkbox_array('prunepkgs', 'prunepkgs', 'Remove the following packages from the base system', $pkgs);
}
-// TODO This shouldn't be a step at all, it should be in wizard.php to choose between bundlers
-// TODO This shouldn't be part of configurations, except possibly a default value. It should be for builds
-$this->select('bundler', 'bundler', 'Image type', array(
- 'tgz' => 'Tar/Gzip',
- 'tbz2' => 'Tar/Bzip2',
- 'installcd' => 'Installer CD with Tar/Bzip2',
- 'livecd' => 'LiveCD',
- 'ext2' => 'ext2',
- 'jffs2' => 'jffs2'
-));
?>
diff --git a/frontend/pages/builds/delete.php b/frontend/pages/builds/delete.php
index b92d28b..384be2d 100644
--- a/frontend/pages/builds/delete.php
+++ b/frontend/pages/builds/delete.php
@@ -25,7 +25,7 @@ function body_builds_delete(&$S) {
case 'uploading':
case 'building':
default:
- $S['build']->failed='false'; // Otherwise doesn't get noticed by backend
+ $S['build']->unset_flag('f'); // Otherwise doesn't get noticed by backend
$S['build']->status='cancel';
$S['build']->write();
echo print_success('Build queued for cancellation.');
diff --git a/frontend/pages/configurations/manager.php b/frontend/pages/configurations/manager.php
index 928ad67..e29ab88 100644
--- a/frontend/pages/configurations/manager.php
+++ b/frontend/pages/configurations/manager.php
@@ -7,13 +7,14 @@ function init_configurations_manager(&$S) {
}
function body_configurations_manager(&$S) {
echo '<h3>Configurations Manager</h3>';
- if (isset($_REQUEST['build']) && isset($_REQUEST['configuration'])) {
+ if (isset($_REQUEST['build'], $_REQUEST['configuration'])) {
$c=new sql_configuration($_REQUEST['configuration']);
- if ($c->owner!=$S['user']->id) {
+ if (!owner_or_admin($c->owner)) {
echo print_error('You do not have permission to build this configuration.');
} else {
$name=isset($_REQUEST['name'])?$_REQUEST['name']:null;
- $build=$c->build($name);
+ $bundler=isset($_REQUEST['bundler'])?$_REQUEST['bundler']:'tbz2';
+ $build=$c->build($name, $bundler);
if (is_object($build))
echo print_success('Submitted for build - <a href="'.url("build/$build->id").'">Logs</a>');
else
@@ -60,6 +61,27 @@ function body_configurations_manager(&$S) {
}
echo "</td></tr>\n";
}
- echo '</table>'.($ready?'Name (optional): <input name="name" /> <input type="submit" name="build" value="Build" />':'').'</form>';
+ echo '</table>';
+ if ($ready) {
+ echo 'Name (optional): <input name="name" /><br/>
+ Bundler: <select name="bundler">
+ <option value="tbz2">Tar/Bzip2</option>
+ <option value="tgz">Tar/Gzip</option>
+ <option value="installcd">Install CD with Tar/Bzip2</option>
+ <option value="livecd">LiveCD</option>
+ <option value="ext2">ext2</option>
+ <option value="jffs2">jffs2</option>
+ </select><br/>
+ <input type="submit" name="build" value="Build" />';
+ }
+ echo '</form>';
+ /*$this->select('bundler', 'bundler', 'Image type', array(
+ 'tgz' => 'Tar/Gzip',
+ 'tbz2' => 'Tar/Bzip2',
+ 'installcd' => 'Installer CD with Tar/Bzip2',
+ 'livecd' => 'LiveCD',
+ 'ext2' => 'ext2',
+ 'jffs2' => 'jffs2'
+ ));*/
}
?>
diff --git a/frontend/pages/configurations/wizard.php b/frontend/pages/configurations/wizard.php
index 6dc6a8e..a7fdb6d 100644
--- a/frontend/pages/configurations/wizard.php
+++ b/frontend/pages/configurations/wizard.php
@@ -54,7 +54,16 @@ function body_configurations_wizard(&$S) {
if (isset($S['wizard']['step']))
$S['wizard']['step']->output();
else
- echo print_success('Config finished!', '<form action="'.url('configurations').'" method="post"><input type="hidden" name="configuration" value="'.$configuration->id.'" />Name (optional): <input name="name" value="'.($configuration->name?htmlentities($configuration->name):'').'" /> <input type="submit" name="build" value="Build" /></form>');
+ echo print_success('Config finished!', '<form action="'.url('configurations').'" method="post"><input type="hidden" name="configuration" value="'.$configuration->id.'" />Name (optional): <input name="name" value="'.($configuration->name?htmlentities($configuration->name):'').'" /><br/>
+ Bundler: <select name="bundler">
+ <option value="tbz2">Tar/Bzip2</option>
+ <option value="tgz">Tar/Gzip</option>
+ <option value="installcd">Install CD with Tar/Bzip2</option>
+ <option value="livecd">LiveCD</option>
+ <option value="ext2">ext2</option>
+ <option value="jffs2">jffs2</option>
+ </select><br/>
+ <input type="submit" name="build" value="Build" /></form>');
} else {
echo '<form action="'.url('create').'" method="post"><h3>Request an image built</h3>Name of your configuration (optional): <input name="name" /><br/>';
if (count($S['conf']['modules']) > 1) {