2 # Display bcond_* macros from given spec
11 if [ $SPEC = "--" ]; then
12 if [ "$#" -lt 2 ]; then
13 echo "Usage: rpm --bcond SPEC"
19 if [ ! -f $SPEC ]; then
20 echo "rpm: $SPEC: no such file"
24 bconds=`awk -F"\n" '/bcond_[_a-z0-9]+/ {
25 match($0, /bcond_[_a-z0-9]+/);
26 print substr($0, RSTART, RLENGTH)
32 if ! echo `rpm --eval "%$c"` | grep $c >/dev/null; then
40 for bcond in $bconds; do
41 isset=`awk -F"\n" "BEGIN { val=0 }
42 /^%define[\t ]+$bcond/ {
43 if (match(\\$0, /$bcond[\t ]+0[\t ]*$/)) {
45 } else if (match(\\$0, /$bcond[\t ]+1[\t ]*$/)) {
48 print \"could determine $bcond value from \", \\$0
50 } END { print val }" $SPEC`;
52 if [ $isset -eq 1 ]; then
53 echo "WARN: $bcond defined in spec";