X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm.git;a=blobdiff_plain;f=rpm-find-spec-bcond;h=a11dece4e0186148483f6a7ddc20e6c4fcf9b45c;hp=8306b4a524381ca1365c527ca0732dd612dbc375;hb=8817aca0949eeb1c64426e90d905a705653989c5;hpb=2a129ee02bd330103f2ec760fe3f2ca0098cdf96 diff --git a/rpm-find-spec-bcond b/rpm-find-spec-bcond index 8306b4a..a11dece 100644 --- a/rpm-find-spec-bcond +++ b/rpm-find-spec-bcond @@ -10,27 +10,27 @@ fi SPEC=$1 if [ $SPEC = "--" ]; then if [ "$#" -lt 2 ]; then - echo "Usage: rpm --bcond SPEC" + echo "Usage: rpmbuild --bcond SPEC" exit 1 fi SPEC=$2 fi if [ ! -f $SPEC ]; then - echo "rpm: $SPEC: no such file" + echo "rpmbuild: $SPEC: no such file" exit 1 fi bconds=`awk -F"\n" 'BEGIN { chlog=0 } /^%changelog/ { chlog=1 } - /_with(out)?_[_a-z0-9]+/ && chlog == 0 { - match($0, /_with(out)?_[_a-z0-9]+/); + /_with(out)?_[_a-zA-Z0-9]+/ && chlog == 0 { + match($0, /_with(out)?_[_a-zA-Z0-9]+/); print substr($0, RSTART, RLENGTH) } /^%bcond_with/ && chlog == 0 { - match($0, /bcond_with(out)?[ ]+[_a-z0-9]+/); + match($0, /bcond_with(out)?[ \t]+[_a-zA-Z0-9]+/); bcond = substr($0, RSTART +5 , RLENGTH -5); - gsub(/ /,"_",bcond); + gsub(/[ \t]+/,"_",bcond); print bcond }' $SPEC | sort -u`