]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- --bcond popt alias (shows b(uild)cond_* macros from given spec)
authormis <mis@pld-linux.org>
Wed, 22 Nov 2000 17:50:47 +0000 (17:50 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-find-spec-bcond -> 1.1
    rpm-rpmpopt.patch -> 1.6

rpm-find-spec-bcond [new file with mode: 0644]
rpm-rpmpopt.patch

diff --git a/rpm-find-spec-bcond b/rpm-find-spec-bcond
new file mode 100644 (file)
index 0000000..56466e9
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Display bcond_* macros from given spec 
+# $Id$
+
+if [ "$#" = 0 ]; then
+    echo "Usage: $0 SPEC"
+    exit 1
+fi
+
+SPEC=$1
+if [ $SPEC = "--" ]; then
+    if [ "$#" -lt 2 ]; then
+       echo "Usage: rpm --bcond SPEC"
+       exit 1
+    fi
+    SPEC=$2
+fi
+
+if [ ! -f $SPEC ]; then
+    echo "rpm: $SPEC: no such file"
+    exit 1
+fi
+
+bconds=`awk -F"\n" '/bcond_[_a-z0-9]+/ {
+               match($0, /bcond_[_a-z0-9]+/);
+              print substr($0, RSTART, RLENGTH)                       
+           }' $SPEC | sort -u`
+
+for c in $bconds; do
+    echo -n "$c"
+
+    if ! echo `rpm --eval "%$c"` | grep $c >/dev/null; then
+       echo " (on)"
+    else 
+       echo ""
+    fi
+done
+
+
+for bcond in $bconds; do
+    isset=`awk -F"\n" "BEGIN { val=0 }
+                   /^%define[\t ]+$bcond/ {
+                     if (match(\\$0, /$bcond[\t ]+0[\t ]*$/)) {
+                        val = 0
+                     } else if (match(\\$0, /$bcond[\t ]+1[\t ]*$/)) {
+                        val = 1
+                     } else {
+                        print \"could determine $bcond value from \", \\$0
+                     }
+                  } END { print val }" $SPEC`;
+
+    if [ $isset -eq 1 ]; then
+       echo "WARN: $bcond defined in spec";
+    fi
+done
+        
index 1db688bb4dd8079bb7522fcecaf58f2b89cef8d2..f38a1574c182f770fa893c84dcd49a8857891168 100644 (file)
@@ -1,7 +1,7 @@
 diff -Nru rpm-4.0/rpmpopt.in rpm-4.0.new/rpmpopt.in
 --- rpm-4.0/rpmpopt.in Wed Nov 15 19:18:35 2000
 +++ rpm-4.0.new/rpmpopt.in     Wed Nov 15 19:18:15 2000
-@@ -80,6 +80,14 @@
+@@ -80,6 +80,17 @@
  # Build policies enabled from command line. Last policy applies.
  rpm alias --buildpolicy --define '__os_install_post @RPMCONFIGDIR@/brp-!#:+'
  
@@ -11,6 +11,9 @@ diff -Nru rpm-4.0/rpmpopt.in rpm-4.0.new/rpmpopt.in
 +# Compiling with debuginfo may be enabled by --debug
 +rpm alias --debug --define 'debug 1'
 +
++# Display spec's bcond_* 
++rpm exec --bcond find-spec-bcond
++
 +# Don't remove $BUILDROOT if --noclean
 +
  # Choose db interface:
This page took 0.167588 seconds and 4 git commands to generate.