summaryrefslogtreecommitdiff
blob: 8da7443702d29bf552648319087263dd8400accb (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
#!/usr/bin/php
<?php
require_once(dirname(__FILE__).'/shared/include/includes.php'); // USE __DIR__ in 5.3.0
$S['conf']['debug']=false;
require_once(SHARED.'/include/dbinit.php');
$profiles=array();
$r=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 {$S['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";
}
$r=query('SELECT * FROM `cache` WHERE `type`="stage3"');
while ($row=$r->fetch(PDO::FETCH_ASSOC)) {
	$entry=new sql_cache_entry($row);
	echo "Reading contents of stage3 file $entry->file...";	
	read_stage3($entry, true);
	echo "done\n";
}
?>