packages: php-pear/php-channel-prov.php (NEW) - scan PEAR channel name from...

glen glen at pld-linux.org
Wed Mar 10 13:47:34 CET 2010


Author: glen                         Date: Wed Mar 10 12:47:34 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- scan PEAR channel name from .reg file

---- Files affected:
packages/php-pear:
   php-channel-prov.php (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/php-pear/php-channel-prov.php
diff -u /dev/null packages/php-pear/php-channel-prov.php:1.1
--- /dev/null	Wed Mar 10 13:47:34 2010
+++ packages/php-pear/php-channel-prov.php	Wed Mar 10 13:47:29 2010
@@ -0,0 +1,20 @@
+#!/usr/bin/php
+<?php
+# Scan files from .channels dir ending with .reg extension for PEAR channel info
+# Author: Elan Ruusamäe <glen at pld-linux.org>
+#
+# Date: 2010-03-10
+# $Id$
+
+if ($argc > 1) {
+    $files = array_splice($argv, 1);
+} else {
+    $files = explode(PHP_EOL, trim(file_get_contents('php://stdin')));
+}
+
+foreach ($files as $file) {
+	if (strstr($file, '.channels') && substr($file, -4) == '.reg') {
+		$reg = unserialize(file_get_contents($file));
+		printf("Provides: php-channel(%s)\n", $reg['name']);
+	}
+}
================================================================


More information about the pld-cvs-commit mailing list