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] [-u] [-t] [-m <MESSAGE>] <SPECLIST>
27 Try to increment package release
31 Test mode. do not commit
33 Specify commit message
39 rel=$(awk '/^%define[ ]+_?rel[ ]+/{print $NF}' $specfile)
40 if [ -z "$rel" ]; then
41 dump=$(get_dump "$specfile")
42 rel=$(echo "$dump" | awk '/PACKAGE_RELEASE/{print $NF; exit}')
52 s/^\(%define[ \t]\+_\?rel[ \t]\+\)$rel\$/\1$newrel/
53 s/^\(Release:[ \t]\+\)$rel\$/\1$newrel/
57 if [ ! -x /usr/bin/getopt ]; then
58 echo >&1 "You need to install util-linux to use relup.sh"
62 t=$(getopt -o 'm:iuth' -n "${0##*/}" -- "$@") || exit $?
63 # Note the quotes around `$t': they are essential!
90 echo 2>&1 "Internal error: [$1] not recognized!"
97 tmpd=$(mktemp -d "${TMPDIR:-/tmp}/relXXXXXX")
99 spec=${spec%.spec}.spec
100 rel=$(get_release "$spec")
101 if [ "$update" = "1" ]; then
104 if [ "$inc" = 1 ]; then
105 newrel=$(expr $rel + 1)
106 set_release "$spec" $rel $newrel
109 rel=$(get_release "$spec")
111 echo "$spec" >> "$tmpd/$rel"
114 for file in $(ls "$tmpd" 2>/dev/null); do
115 files=$(cat "$tmpd/$file")
116 rel=$(basename "$file")
117 msg="- release $rel${message:+ ($message)}"
118 echo cvs ci -m "'$msg'"
119 if [ "$test" != 1 ]; then
120 cvs ci -m "$msg" $files