Use rpm-specdump if it exists, rpm.org rpm can't do 'rpm dump %prep'
authorJan Rękorajski <baggins@pld-linux.org>
Fri, 26 Feb 2021 07:58:12 +0000 (08:58 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Fri, 26 Feb 2021 07:58:12 +0000 (08:58 +0100)
relup.sh

index 8cc645d58d96e318bc57a2501e8eb25261b65efa..8267436e1efc2c5cc295941189c01a0176365044 100755 (executable)
--- a/relup.sh
+++ b/relup.sh
@@ -8,12 +8,19 @@ set -e
 
 get_dump() {
        local specfile="$1"
-       if ! out=$(rpm --specfile "$specfile" --define 'prep %dump' -q 2>&1); then
-               echo >&2 "$out"
+       local rpm_dump
+       local success="y"
+       if [ -x /usr/bin/rpm-specdump ]; then
+               rpm_dump=$(rpm-specdump "$specfile" 2>&1) || success="n"
+       else
+               rpm_dump=$(rpm --specfile "$specfile" --define 'prep %dump' -q 2>&1) || success="n"
+       fi
+       if [ "$success" != "y" ]; then
+               echo >&2 "$rpm_dump"
                echo >&2 "You need icon files being present in SOURCES."
                exit 1
        fi
-       echo "$out"
+       echo "$rpm_dump"
 }
 
 usage="Usage:
This page took 0.07444 seconds and 4 git commands to generate.