blob: 8b0fab4e57361770ff8e0e36925ff7c53743423b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/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');
$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)) {
$p=new sql_gentoo_profile($p);
echo ($p->name?$p->name:$p->pkgdir)."\n";
$packages=$p->get_packages(false, array('desc', 'masked'));
foreach ($packages as $bcat => $lcats) {
foreach ($lcats as $lcat => $pkgs) {
foreach ($pkgs as $name => $vers) {
foreach ($vers as $ver => $attrs) {
echo ($attrs['masked']?color('[MASKED] ', 'red'):'')."$bcat$lcat/$name-$ver: ".$attrs['desc']."\n";
}
}
}
}
}
?>
|