blob: 35dc91ec46a111c168c8f474bd7efa889795d9b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<?php
$file=CACHE.'/stage3/'.$profile->stage3;
$opt='-xv'.(substr($file, -3) == 'bz2'?'j':'z').'f';
execute_command('Unpack base system', "tar $opt '$file' -C '$I'");
if ($opts['basesystem'] == 'manual' && $opts['prunepkgs']) {
portage_install($opts['prunepkgs'], 'Prune base system packages', '-C');
} elseif ($opts['basesystem'] == 'autoprune') {
throw_exception('Base system autoprune not implemented - need package list');
$keep=explode(' ', $keep_pkgs);
$remove=array();
$r=$S['pdo']->query('SELECT * FROM `gentoo_basepkgs` WHERE `profile`='.$profile->id);
while ($pkg=$r->fetch(PDO::FETCH_ASSOC)) {
$pkg=$pkg['pkg'];
if (($i=array_search($pkg, $keep)) === false)
$remove[]=$pkg;
else
unset($keep[$i]);
}
portage_install($remove, 'Automatically prune base system packages', '-C');
}
?>
|