#!/usr/bin/php 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"; } ?>