]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm-php-provides
- updated for 4.4.9 (but probably not needed at all)
[packages/rpm.git] / rpm-php-provides
index 039499e515d08fbb90b58a9c6733b1a4ebdd7e70..ebbab977b4b2545425080cfff9a9403cc6d04e94 100644 (file)
@@ -1,14 +1,17 @@
-#!/bin/sh
-if [ $# -lt 1 ]; then
-       echo "You have to specify input file"
-       exit 1
-fi
+#!/usr/bin/perl
+#####################################################################
+#                                                                   #
+# Small script to generate provides for php-pear/php-pecl           #
+#                                                                   #
+# Adam Go³êbiowski <adamg@pld-linux.org>                            #
+#                                                                   #
+# Somehow based on previous work by:                                #
+# Pawe³ Go³aszewski <blues@pld-linux.org>                           #
+# Micha³ Moskal <malekith@pld-linux.org>                            #
+#####################################################################
 
-filelist=`echo $@`
-for i in $filelist; do
-       j=`cat $i |egrep -i "^Class" |cut -f 2 -d " "`
-       if [ -n "$j" ]; then
-               echo "Provides: pear($j)"
-       fi
-       j=""
-done
+# Contest: shrink this one to oneliner 
+# Bonus  : and fit in 80 columns ;)
+
+/package.xml/ and open(F, $_) foreach (@ARGV ? @ARGV : <> );
+/^\s+\<name\>([a-zA-Z0-9\_]+)\<\/name\>$/ and print "php-pear-$1" while (<F>);
This page took 0.029671 seconds and 4 git commands to generate.