2 # script to run after "release bump" style change.
3 # takes Release from spec and creates commit with message
4 # groups similiar commits together.
11 if ! out=$(rpm --specfile "$specfile" --define 'prep %dump' -q 2>&1); then
13 echo >&2 "You need icon files being present in SOURCES."
20 ${0##*/} [-i] [-u] [-t] [-n] [-m <MESSAGE>] <SPECLIST>
24 Try to increment package release
28 Test mode (dry-run). do not commit
30 Specify commit message
36 rel=$(awk '/^%define[ ]+_?rel[ ]+/{print $NF}' $specfile)
37 if [ -z "$rel" ]; then
38 dump=$(get_dump "$specfile")
39 rel=$(echo "$dump" | awk '/PACKAGE_RELEASE/{print $NF; exit}')
49 s/^\(%define[ \t]\+_\?rel[ \t]\+\)$rel\$/\1$newrel/
50 s/^\(Release:[ \t]\+\)$rel\$/\1$newrel/
54 if [ ! -x /usr/bin/getopt ]; then
55 echo >&1 "You need to install util-linux to use relup.sh"
59 t=$(getopt -o 'm:inuth' -n "${0##*/}" -- "$@") || exit $?
60 # Note the quotes around `$t': they are essential!
87 echo 2>&1 "Internal error: [$1] not recognized!"
94 tmpd=$(mktemp -d "${TMPDIR:-/tmp}/relXXXXXX")
96 spec=${spec%.spec}.spec
97 if [ "$update" = "1" ]; then
100 rel=$(get_release "$spec")
101 if [ "$inc" = 1 ]; then
102 if [[ $rel = *%* ]]; then
105 newrel=$(expr ${relnum} + 1)
106 set_release "$spec" $rel "${newrel}%${relmacro}"
108 newrel=$(expr ${rel} + 1)
109 set_release "$spec" $rel $newrel
113 rel=$(get_release "$spec")
115 echo "$spec" >> "$tmpd/$rel"
120 for file in $(ls "$tmpd" 2>/dev/null); do
121 files=$(cat "$tmpd/$file")
122 rel=$(basename "$file")
124 [ -n "$message" ] && msg="$msg- $message$n"
125 msg="$msg- release $rel$n"
126 echo cvs ci -m "'$msg'"
127 if [ "$test" != 1 ]; then
128 cvs ci -m "$msg" $files