]>
Commit | Line | Data |
---|---|---|
5e6a7761 ER |
1 | #!/usr/bin/php |
2 | <?php | |
3 | # Scan files from .channels dir ending with .reg extension for PEAR channel info | |
4 | # Author: Elan Ruusamäe <glen@pld-linux.org> | |
5 | # | |
6 | # Date: 2010-03-10 | |
7 | # $Id$ | |
8 | ||
9 | if ($argc > 1) { | |
10 | $files = array_splice($argv, 1); | |
11 | } else { | |
12 | $files = explode(PHP_EOL, trim(file_get_contents('php://stdin'))); | |
13 | } | |
14 | ||
15 | foreach ($files as $file) { | |
16 | if (strstr($file, '.channels') && substr($file, -4) == '.reg') { | |
17 | $reg = unserialize(file_get_contents($file)); | |
18 | printf("Provides: php-channel(%s)\n", $reg['name']); | |
19 | } | |
20 | } |