summaryrefslogtreecommitdiff
blob: 7074049cbaa7a5c01fa740e921d6b6d6d7c831cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
global $S;
$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($this->get_opt('profile'));
if (strlen($pkgsets=$this->get_opt('pkgsets'))) {
	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);
	}
}
if (in_array('pruneinit', $opts)) {
	$r=query('SELECT * FROM `gentoo_baseinit` WHERE `profile`='.$profile->id.' ORDER BY `name`, `runlevel`');
	$scripts=array();
	while ($script=$r->fetch(PDO::FETCH_ASSOC)) {
		$script=new sql_gentoo_baseinit($script);
		$scripts["$script->name:$script->runlevel"]="$script->name ($script->runlevel)";
	}
	$this->checkbox_array('pruneinit', 'pruneinit', 'Remove the following init scripts', $scripts);
}
if ($this->get_opt('basesystem') == 'manual') {
	$r=query('SELECT * FROM `gentoo_basepkgs` WHERE `profile`='.$profile->id.' ORDER BY `pkg`');
	$pkgs=array();
	while ($pkg=$r->fetch(PDO::FETCH_ASSOC)) {
		$pkg=$pkg['pkg'];
		$pkgs[$pkg]=$pkg;
	}
	$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'
));
?>