summaryrefslogtreecommitdiff
blob: 539da815331b9898f48639edef2680c14ff79eea (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
<?

	require_once 'header.php';
	
	if(!$tree) {
		$tree =& PortageTree::singleton();
	}
	
	// FIXME This is really dumb, just grab all the arches
	// since I look at all of them now.
	$arr_arches = $tree->getArches();
	$arr_arches = array_merge($arr_arches, $tree->getArches(true));
	
	$arr = importDiff('arch', $arr_arches);
	
	if(count($arr['delete'])) {
		foreach($arr['delete'] as $name) {
			$sql = "DELETE FROM arch WHERE name = ".$db->quote($name).";";
			shell::msg($sql);
			$db->query($sql);
		}
	}
	
	if(count($arr['insert'])) {
		foreach($arr['insert'] as $name) {
			$arr_insert = array('name' => $name);
			$db->autoExecute('arch', $arr_insert, MDB2_AUTOQUERY_INSERT);
		}
	}
	
	unset($arr);

?>