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."
23 ${0##*/} [-i] [-t] [-m <MESSAGE>] <SPECLIST>
27 Try to increment package release
29 Test mode. do not commit
31 Specify commit message
37 rel=$(awk '/^%define[ ]+_?rel[ ]+/{print $NF}' $specfile)
38 if [ -z "$rel" ]; then
39 dump=$(get_dump "$specfile")
40 rel=$(echo "$dump" | awk '/PACKAGE_RELEASE/{print $NF; exit}')
50 s/^\(%define[ \t]\+_\?rel[ \t]\+\)$rel\$/\1$newrel/
51 s/^\(Release:[ \t]\+\)$rel\$/\1$newrel/
55 if [ ! -x /usr/bin/getopt ]; then
56 echo >&1 "You need to install util-linux to use relup.sh"
60 t=$(getopt -o 'm:ith' -n "${0##*/}" -- "$@") || exit $?
61 # Note the quotes around `$t': they are essential!
85 echo 2>&1 "Internal error: [$1] not recognized!"
92 tmpd=$(mktemp -d "${TMPDIR:-/tmp}/relXXXXXX")
94 spec=${spec%.spec}.spec
95 rel=$(get_release "$spec")
96 if [ "$inc" = 1 ]; then
97 newrel=$(expr $rel + 1)
98 set_release "$spec" $rel $newrel
101 rel=$(get_release "$spec")
103 echo "$spec" >> "$tmpd/$rel"
106 for file in $(ls "$tmpd" 2>/dev/null); do
107 files=$(cat "$tmpd/$file")
108 rel=$(basename "$file")
109 msg="- rel $rel${message:+ ($message)}"
110 echo cvs ci -m "'$msg'"
111 if [ "$test" != 1 ]; then
112 cvs ci -m "$msg" $files