summaryrefslogtreecommitdiff
blob: 747a43662d1b15dd1c94c30a12e590da0df44207 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/php
<?php
require_once(dirname(__FILE__).'/shared/include/includes.php'); // USE __DIR__ in 5.3.0
require_once(SHARED.'/config.php');
require_once(SHARED.'/include/dbinit.php');
$pdo=&$S['pdo'];
$r=$pdo->query('SELECT * FROM `profiles`'.(isset($argv[1])?' WHERE `name` LIKE "%'.$argv[1].'%" OR `pkgdir` LIKE "%'.$argv[1].'%"':''));
while ($p=$r->fetch(PDO::FETCH_ASSOC)) {
	$p=new sql_profile($p);
	echo ($p->name?$p->name:$p->pkgdir)."\n";
	$packages=$p->get_packages();
	foreach ($packages as $cat => $pkg) {
		foreach ($pkg as $name => $vers) {
			foreach ($vers as $ver => $attrs) {
				echo ($attrs['masked']?color('[MASKED] ', 'red'):'')."$cat/$name-$ver: ".$attrs['description']."\n";
			}
		}
	}
}
?>