Changed files:
relup.sh -> 1.4
#!/bin/sh
# script to run after "rel up" style change.
# takes Release from spec and creates commit with message
#!/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.
+# - 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"
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
}
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}')