]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- improved error detection to catch spec parse errors
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 25 Dec 2005 11:03:01 +0000 (11:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    relup.sh -> 1.4

relup.sh

index 722454d01af16c0499064bbd46714bb8174aa3d6..2c481aba8148bb8b18ed90cae77e191bd5ad4981 100644 (file)
--- a/relup.sh
+++ b/relup.sh
@@ -1,22 +1,30 @@
 #!/bin/sh
 # script to run after "rel up" style change.
 # takes Release from spec and creates commit with message
-# groups similiar commits to gether.
+# groups similiar commits together.
 # "- rel $rel"
+# - fails when specfile defines Icon: but the icon is not present in SOURCES
+# TODO
+# - optional message after rel: "- rel 9 (rebuild with foolib)"
 
 set -e
 specfile="$1"
 
 get_dump() {
        local specfile="$1"
-       rpm --specfile "$specfile" --define 'prep %dump' -q 2>&1
+       if ! out=$(rpm --specfile "$specfile" --define 'prep %dump' -q 2>&1); then
+               echo >&2 "$out"
+               echo >&2 "You need icon files being present in SOURCES."
+               exit 1
+       fi
 }
 
 get_release() {
        local specfile="$1"
        rel=$(awk '/^%define.*_rel/{print $NF}' $specfile)
        if [ -z "$rel" ]; then
-               rel=$(get_dump "$specfile" | awk '/PACKAGE_RELEASE/{print $NF; exit}')
+               dump=$(get_dump "$specfile")
+               rel=$(echo "$dump" | awk '/PACKAGE_RELEASE/{print $NF; exit}')
        fi
        echo $rel
 }
This page took 0.063657 seconds and 4 git commands to generate.