]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- completely rewritten - new scheme to find requires (much better, I think)
authorPaweł Gołaszewski <blues@pld-linux.org>
Fri, 12 Jul 2002 12:10:41 +0000 (12:10 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-php-requires -> 1.9

rpm-php-requires

index a6b24c1c05dd4033fa491e78ae8b43b683aff541..203aefbc8a0fad497c7397c2328901fa3f3c2d06 100644 (file)
@@ -1,19 +1,46 @@
 #!/bin/sh
+#####################################################################
+#                                                                   #
+# Check system dependences between php-pear modules                 #
+#                                                                   #
+# Pawe³ Go³aszewski <blues@ds.pg.gda.pl>                            #
+# ------------------------------------------------------------------#
+# TODO:                                                             #
+# - extension_loaded - dependencies.                                #
+# - some clean-up...                                                #
+#####################################################################
 if [ $# -lt 1 ]; then
        echo "You have to specify input file"
        exit 1
 fi
 
-for i in `echo $@`; do
-       i=`echo $i | grep "\.php$"`
-       if [ -n "$i" ]; then
-               j=`cat $i | grep -i ^require_once | egrep -v "^ \*" | sed -e "s/['|\"]//" | sed -e "s/(/ /" | cut -f 2 -d " " | sed -e "s/\//_/g" | cut -f 1 -d "."`
+for files in `echo $@`; do
+       files=`echo $files | grep "\.php$"`
+       if [ -n "$files" ]; then
+               # Requires trough  new call:
+               j=`cat $files | grep -i new | egrep "(=|return)" | egrep -v "^[[:space:]*]*(\/\/|#|\*|/\*)" | tr -d "\r" | egrep "[;|(|)|{|}|,][[:space:]*]*$" | awk -F "new " '{ print $2 }' | sed "s/[(|;|.]/ /g" | cut -f 1 -d " " | sed "s/^$.*//"`
                if [ -n "$j" ]; then
-                       for p in $j; do
-                               echo "pear($p)"
+                       for feature in $j; do
+                               echo "pear($feature)"
                        done
                        j=""
                fi
+               # requires trough class extension
+               k=`cat $files | egrep -i "(^Class.*extends)" | awk -F " extends " '{ print $2 }' | sed "s/{.*/ /" | cut -f 1 -d " " | tr -d "\r"`
+               if [ -n "$k" ]; then
+                       for feature in $k; do
+                               echo "pear($feature)"
+                       done
+                       k=""
+               fi
+               # requires trough class:: call
+               l=`cat $files | grep "::" | egrep -v "^[[:space:]*]*(\/\/|#|\*|/\*)" | sed "s/[(|'|!|\"|&|@|;]/ /g" | awk -F "::" '{ print $1 }' | sed "s/.*\ \([:alphanum:]*\)/\1/" | sed "s/^$.*//" | sed "s/[.]//g" | tr -d "\r"`
+               if [ -n "$l" ]; then
+                       for feature in $l; do
+                               echo "pear($feature)"
+                       done
+                       l=""
+               fi
        fi
 done
 
This page took 0.039735 seconds and 4 git commands to generate.