blob: 2ccb6b7945028d45ae69c019518f90a0400c9883 (
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
52
53
54
55
56
57
58
59
60
61
62
63
64
|
<?
// $verbose = true;
// $qa = true;
// $debug = true;
require_once 'header.php';
require_once 'class.portage.tree.php';
require_once 'class.portage.category.php';
require_once 'class.portage.package.php';
require_once 'class.portage.ebuild.php';
// Find all the ebuilds that are missing ebuild arch
$sql = "SELECT * FROM missing_metadata;";
$arr = $db->getAssoc($sql);
if($verbose)
shell::msg(number_format(count($arr))." ebuilds to check");
foreach($arr as $ebuild_id => $row) {
extract($row);
$obj_ebuild = new PortageEbuild("$category/$pf");
if($debug)
shell::msg("[$category/".$obj_ebuild->pn."]");
$arr_metadata = $obj_ebuild->metadata();
if(count($arr_metadata)) {
foreach($arr_metadata as $keyword => $value) {
if(!empty($value)) {
$arr_insert = array(
'ebuild' => $ebuild_id,
'keyword' => $keyword,
'value' => $value,
);
$db->autoExecute('ebuild_metadata', $arr_insert, MDB2_AUTOQUERY_INSERT);
}
}
} else {
if($verbose || $qa)
shell::msg("[QA] No metadata: $category/".$obj_ebuild->pf);
}
}
// Set the new package descriptions
$sql = "SELECT COUNT(1) FROM package WHERE status = 1;";
$count = $db->getOne($sql);
if($count) {
if($verbose)
shell::msg("Setting the new package descriptions for $count packages");
$sql = "UPDATE package SET description = package_description(id) WHERE id IN (SELECT p.id FROM package p INNER JOIN package_recent pr ON pr.package = p.id WHERE p.status = 1 AND p.portage_mtime = pr.max_ebuild_mtime);";
$db->query($sql);
}
?>
|