summaryrefslogtreecommitdiff
blob: d2e67e97f8e8b93f735cffc42dfdae2865631ffa (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
50
51
<?

	$verbose = true;
	$qa = true;	


	require_once 'header.php';
	require_once 'import.functions.php';
	
	// Also fix the levels
	$sql = "UPDATE ebuild e SET lvl = CASE
            WHEN e.p IS NOT NULL THEN 6
            WHEN e.rc IS NOT NULL THEN 4
            WHEN e.pre IS NOT NULL THEN 3
            WHEN e.beta IS NOT NULL THEN 2
            WHEN e.alpha IS NOT NULL THEN 1
            ELSE 5
        END;";
	$db->query($sql);
	
	$sql = "SELECT * FROM missing_ev;";
	$arr = $db->getAll($sql);
	
	$arr_packages = array();
	
	foreach($arr as $row) {
		extract($row);
		$arr_packages[$package][$ebuild] = $version;
	
	}
	
	foreach($arr_packages as $package => $arr) {
	
// 		print_r($arr);
		
		$ext = extendVersions($arr);
		
// 		print_r($ext); die;
		
		foreach($ext as $ebuild => $ev) {
			$arr_update = array('ev' => $ev);
			$db->autoExecute('ebuild', $arr_update, MDB2_AUTOQUERY_UPDATE, "id = $ebuild");
		}
		
	}
	
// 	print_r($arr_packages);
	
	
	
?>