blob: e9f3ead4d229f1d7864404df65e007cf247f762e (
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
|
#!/usr/bin/php
<?php
require_once(dirname(__FILE__).'/shared/include/includes.php'); // USE __DIR__ in 5.3.0
require_once(SHARED.'/config.php');
require_once(SHARED.'/include/dbinit.php');
$pdo=&$S['pdo'];
$profiles=array();
$r=$pdo->query('SELECT * FROM `gentoo_profiles`'.(isset($argv[1])?' WHERE `name` LIKE "%'.$argv[1].'%" OR `pkgdir` LIKE "%'.$argv[1].'%"':''));
while ($p=$r->fetch(PDO::FETCH_ASSOC)) {
$profiles[$p['id']]=new sql_gentoo_profile($p);
$profile=&$profiles[$p['id']];
echo "Updating from {$conf['pkgdir_root']}/$profile->pkgdir/Packages...\n";
list($new, $updated, $deleted, $total)=$profile->read_Packages(true, true);
echo "Packages: $new new, $updated updated, $deleted deleted, $total total.\n";
echo 'Updating package sets...';
$profile->read_pkgsets(true);
echo "done\n";
}
foreach (explode("\n", trim(file_get_contents(CACHE.'/stage3/map'))) as $line) {
list($p, $file)=explode(' ', $line, 2);
if (!is_numeric($p)) continue;
$profile=&$profiles[$p];
if ($profile->stage3 == $file) continue;
$profile->stage3=$file;
$profile->write();
echo "Loading info from profile $profile->pkgdir stage3 at $file...";
echo ($profile->read_stage3(true)?'done':color('failed', 'red'))."\n";
}
?>
|