X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm.git;a=blobdiff_plain;f=rpm-php-provides;h=a094cba8805a5a7b0ccafc482f7d14c63f2110e2;hp=91baf9cabef1b992bd5ee1794c244c18919ff395;hb=58639ed6a0563b2f93ab436bbe31aec535bcc89d;hpb=a4ff8dab6d8eb2d34e6df1688a6e26d37ebd8bf7 diff --git a/rpm-php-provides b/rpm-php-provides index 91baf9c..a094cba 100644 --- a/rpm-php-provides +++ b/rpm-php-provides @@ -1,28 +1,20 @@ -#!/bin/sh +#!/usr/bin/perl ##################################################################### # # # Check system dependences between php-pear modules # # # # Pawe³ Go³aszewski # +# Micha³ Moskal # # ------------------------------------------------------------------# # TODO: # ##################################################################### -if [ $# -lt 1 ]; then - echo "You have to specify input file" - exit 1 -fi +$pear = "/usr/share/pear"; -filelist=`echo $@` -for i in $filelist; do - i=`echo $i | grep "\.php$"` - if [ -n "$i" ]; then - j=`cat $i | egrep -i "^Class" | cut -f 2 -d " " | sed "s/{/ /" | tr -d "\r"` - if [ -n "$j" ]; then - for p in $j; do - echo "pear($p)" - done - j="" - fi - fi -done +foreach (@ARGV ? @ARGV : <>) { + chomp; + $f = $_; + next unless ($f =~ /$pear.*\.php$/); + $f =~ s/.*$pear\///; + print "pear($f)\n"; +}