summaryrefslogtreecommitdiff
blob: 36db97e50e2242441d887c16496cef72efc9b22d (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
<?

	require_once 'header.php';
	require_once 'class.portage.tree.php';
	require_once 'class.portage.use_flag.php';
	require_once 'class.portage.ebuild.php';
	require_once 'class.portage.atom.php';
	require_once '/home/steve/svn/znurt/class.db.mtime.php';
	require_once '/home/steve/svn/znurt/class.db.use.php';
	require_once '/home/steve/svn/znurt/class.db.package_use.php';
	require_once 'File/Find.php';
	
	$tree = new PortageTree();
	
  	// Local use flags
 	$type = 'local';
 	$u = new PortageUseFlag($type);
  	$filemtime = filemtime($u->filename);
  	$arr_use_flags[$type] = $u->getUseFlags();
  	$keys = array_keys($arr_use_flags[$type]);
  	
  	$dbmtime = new DBMtime($u->filename);
  	
  	if(is_null($dbmtime->mtime)) {
		$dbmtime->mtime = $dbmtime->filemtime;
	} elseif($filemtime > $dbmtime->mtime) {
		$dbmtime->mtime = $filemtime;
	}
  	
  	foreach($arr_use_flags[$type] as $cp => $arr_package_use_flags) {
  	
  		$sql = "SELECT package FROM view_package WHERE cp = ".$db->quote($cp).";";
  		$package = $db->getOne($sql);
  		
  		foreach($arr_package_use_flags as $name => $arr) {
  			extract($arr);
  			
  			$dbuse = new DBUse($name, 'local', $cp);
  			
  			$dbpackage_use = new DBPackageUse($package, $dbuse->id);
  			
  			if($dbpackage_use->description != $description)
  				$dbpackage_use->description = $description;
  			
  			
  		}
  	}

?>