]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- add _noautoreq if missing and needed
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 2 Apr 2006 13:06:56 +0000 (13:06 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    pearize.sh -> 1.38

pearize.sh

index a34ff593eabc9165a81122ee93e461ce5656ff13..6d28c0027d70def7a025b03bf8b9c6c2018af0f6 100644 (file)
@@ -112,11 +112,23 @@ optional=$(grep '^Optional:' $template || :)
 if [ -n "$optional" ]; then
        echo "$optional" | while read tag dep; do
                for req in $dep; do
-                       m=$(grep "^%define.*_noautoreq" $spec | grep -o "$req" || :)
+                       echo add dep: $dep
+                       set -x
+                       m=$(grep "^%define.*_noautoreq" $spec || :)
                        if [ -z "$m" ]; then
-                               # FIXME: fails if _noautoreq is not present
-                               sed -i -e "/^%define.*_noautoreq/s,$, $req," $spec
+                               sed -i -e "/^BuildRoot:/{
+                                       a
+                                       a# exclude optional dependencies
+                                       a%define\       \       _noautoreq\     $req
+                               }
+                               " $spec
+                       else
+                               m=$(echo "$m" | grep -o "$req" || :)
+                               if [ -z "$m" ]; then
+                                       sed -i -e "/^%define.*_noautoreq/s,$, $req," $spec
+                               fi
                        fi
+                       set -
                done
        done
 fi
This page took 0.03044 seconds and 4 git commands to generate.