]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm-find-spec-bcond
- ugly gcc hack not needed.
[packages/rpm.git] / rpm-find-spec-bcond
index 0db70f80124e83581fad66eb275080ec93ceddbd..40ad15495ed80ba83e674d8bfbf32c90aa20daf3 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Display bcond_* macros from given spec 
+# Display bcond (_with_*, _without_*) macros from given spec 
 # $Id$
 
 if [ "$#" = 0 ]; then
@@ -23,10 +23,16 @@ fi
 
 bconds=`awk -F"\n" 'BEGIN { chlog=0 }
                /^%changelog/ { chlog=1 }
-               /bcond_[_a-z0-9]+/ && chlog == 0 {
-                       match($0, /bcond_[_a-z0-9]+/);
+               /_with(out)?_[_a-zA-Z0-9]+/ && chlog == 0 {
+                       match($0, /_with(out)?_[_a-zA-Z0-9]+/);
                        print substr($0, RSTART, RLENGTH)                       
-               }' $SPEC | sort -u`
+               }
+               /^%bcond_with/ && chlog == 0 {
+                       match($0, /bcond_with(out)?[    ]+[_a-zA-Z0-9]+/);
+                                bcond = substr($0, RSTART +5 , RLENGTH -5);
+                                gsub(/ /,"_",bcond);
+                                print bcond
+                       }' $SPEC | sort -u`
 
 for c in $bconds; do
     echo -n "$c"
@@ -51,7 +57,7 @@ for bcond in $bconds; do
                      }
                   } END { print val }" $SPEC`;
 
-    if [ $isset -eq 1 ]; then
+    if [ x"$isset" = x"1" ]; then
        echo "WARN: $bcond defined in spec";
     fi
 done
This page took 0.234879 seconds and 4 git commands to generate.