2 # script to run after "rel up" style change.
3 # takes Release from spec and creates commit with message
4 # groups similiar commits together.
6 # - fails when specfile defines Icon: but the icon is not present in SOURCES
8 # - optional message after rel: "- rel 9 (rebuild with foolib)"
14 if ! out=$(rpm --specfile "$specfile" --define 'prep %dump' -q 2>&1); then
16 echo >&2 "You need icon files being present in SOURCES."
24 rel=$(awk '/^%define[ ]*_rel[ ]/{print $NF}' $specfile)
25 if [ -z "$rel" ]; then
26 dump=$(get_dump "$specfile")
27 rel=$(echo "$dump" | awk '/PACKAGE_RELEASE/{print $NF; exit}')
32 if [ ! -x /usr/bin/getopt ]; then
33 echo >&1 "You need to install util-linux to use relup.sh"
37 t=`getopt -o 'm:' -n $(dirname "$0") -- "$@"` || exit $?
38 # Note the quotes around `$TEMP': they are essential!
52 echo 2>&1 "Internal error: [$1] not recognized!"
59 tmpd=$(mktemp -d "${TMPDIR:-/tmp}/relXXXXXX")
61 spec=${spec%.spec}.spec
62 rel=$(get_release "$spec")
63 echo "$spec" >> "$tmpd/$rel"
66 for file in $(ls "$tmpd" 2>/dev/null); do
67 files=$(cat "$tmpd/$file")
68 rel=$(basename "$file")
69 echo cvs ci -m "'- rel $rel${message:+ ($message)}'"
70 cvs ci -m "$msg" $files