diff options
author | Eudyptula <eitan@mosenkis.net> | 2009-07-16 16:39:03 -0400 |
---|---|---|
committer | Eudyptula <eitan@mosenkis.net> | 2009-07-16 16:39:03 -0400 |
commit | b04ca72439752a5c964c75b18994311d0aef5618 (patch) | |
tree | 13a190764f26bffea538ea77aaa7a15108c454cd /frontend | |
parent | Add dev-manager support to gentoo/portage modules (diff) | |
download | ingenue-b04ca72439752a5c964c75b18994311d0aef5618.tar.gz ingenue-b04ca72439752a5c964c75b18994311d0aef5618.tar.bz2 ingenue-b04ca72439752a5c964c75b18994311d0aef5618.zip |
Added predefined package sets; separated gentoo-specific setup into gentoo_setup.php
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/modules/gentoo/step2.php | 19 | ||||
-rw-r--r-- | frontend/modules/gentoo/step3.php | 28 | ||||
-rw-r--r-- | frontend/modules/gentoo/step4.php | 25 | ||||
-rw-r--r-- | frontend/modules/gentoo_common.php | 2 |
4 files changed, 48 insertions, 26 deletions
diff --git a/frontend/modules/gentoo/step2.php b/frontend/modules/gentoo/step2.php index b5b95df..2c9f769 100644 --- a/frontend/modules/gentoo/step2.php +++ b/frontend/modules/gentoo/step2.php @@ -1,12 +1,13 @@ <?php +$this->checkbox_array('options', 'options', 'Configuration options', array('timezone' => 'Select timezone', 'dev-manager' => 'Select /dev manager')); $profile=new sql_gentoo_profile($this->get_opt('profile')); -$pkgs=$profile->get_packages(); -$meta=array( - array('id' => 'plist', 'autosize'=> true), - array('delim' => '', 'tag' => 'div', 'label' => '%n', 'collapsed' => true), - array('delim' => '/', 'tag' => 'div', 'label' => '%p', 'collapsed' => true), - array('delim' => '-', 'tag' => 'div', 'label' => '%p: $desc', 'checkbox' => '%p', 'collapsed' => true, 'search' => true), - array('tag' => 'div', 'label' => '=%p', 'checkbox' => '=%p', 'search' => true) -); -$this->layered_checkbox_array('install_packages', 'p', null, $pkgs, ' ', $meta); +global $S; +$pkgsets=array(); +$r=$S['pdo']->query('SELECT * FROM `gentoo_pkgsets` WHERE `profile`='.$profile->id); +while ($pkgset=$r->fetch(PDO::FETCH_ASSOC)) { + $pkgset=new sql_gentoo_pkgset($pkgset); + $pkgsets[$pkgset->id]=$pkgset->name; +} +if ($pkgsets) + $this->checkbox_array('pkgsets', 'pkgsets', 'Select packages from the following groups', $pkgsets); ?> diff --git a/frontend/modules/gentoo/step3.php b/frontend/modules/gentoo/step3.php index ee0cb84..89e7ec3 100644 --- a/frontend/modules/gentoo/step3.php +++ b/frontend/modules/gentoo/step3.php @@ -1,3 +1,29 @@ <?php -$this->checkbox_array('options', 'options', null, array('timezone' => 'Select timezone', 'dev-manager' => 'Select /dev manager')); +$opts=explode(' ', $this->get_opt('options')); +if (in_array('timezone', $opts)) + $this->select('timezone', 'timezone', 'Timezone', get_timezones()); +if (in_array('dev-manager', $opts)) + $this->select('dev-manager', 'dev-manager', '/dev Manager', array('udev' => 'udev', 'static-dev' => 'Static /dev')); +$profile=new sql_gentoo_profile($opts['profile']); +foreach (explode(' ', $this->get_opt('pkgsets')) as $pkgset) { + $pkgset=new sql_gentoo_pkgset($pkgset); + $pkgs=array(); + foreach (explode("\n", $pkgset->packages) as $pkg) { + if ($obj=sql_gentoo_package::from_atom($pkg, $profile)) { + $array=$obj->to_array(); + $pkgs[$pkg]="$pkg: {$array['desc']}"; + } + } + $this->checkbox_array('pkgset-'.$pkgset->id, 'pkgset-'.$pkgset->id, $pkgset->name, $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/modules/gentoo/step4.php b/frontend/modules/gentoo/step4.php index 3eb3e1d..b5b95df 100644 --- a/frontend/modules/gentoo/step4.php +++ b/frontend/modules/gentoo/step4.php @@ -1,17 +1,12 @@ <?php -$opts=explode(' ', $this->get_opt('options')); -if (in_array('timezone', $opts)) - $this->select('timezone', 'timezone', 'Timezone', get_timezones()); -if (in_array('dev-manager', $opts)) - $this->select('dev-manager', 'dev-manager', '/dev Manager', array('udev' => 'udev', 'static-dev' => 'Static /dev')); -// 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' -)); +$profile=new sql_gentoo_profile($this->get_opt('profile')); +$pkgs=$profile->get_packages(); +$meta=array( + array('id' => 'plist', 'autosize'=> true), + array('delim' => '', 'tag' => 'div', 'label' => '%n', 'collapsed' => true), + array('delim' => '/', 'tag' => 'div', 'label' => '%p', 'collapsed' => true), + array('delim' => '-', 'tag' => 'div', 'label' => '%p: $desc', 'checkbox' => '%p', 'collapsed' => true, 'search' => true), + array('tag' => 'div', 'label' => '=%p', 'checkbox' => '=%p', 'search' => true) +); +$this->layered_checkbox_array('install_packages', 'p', null, $pkgs, ' ', $meta); ?> diff --git a/frontend/modules/gentoo_common.php b/frontend/modules/gentoo_common.php index ee2e7f1..b1e36b6 100644 --- a/frontend/modules/gentoo_common.php +++ b/frontend/modules/gentoo_common.php @@ -1,4 +1,4 @@ <?php -$steps=array('Profile', 'Packages', 'Extra Options', 'Etc.'); +$steps=array('Profile', 'Extra Options', 'Etc.', 'Misc. Packages'); $dir='gentoo'; ?> |