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}')
36 s/^\(%define[ \t]\+_rel[ \t]\+\).\+/\1$rel/
40 if [ ! -x /usr/bin/getopt ]; then
41 echo >&1 "You need to install util-linux to use relup.sh"
45 t=$(getopt -o 'm:it' -n $(dirname "$0") -- "$@") || exit $?
46 # Note the quotes around `$t': they are essential!
66 echo 2>&1 "Internal error: [$1] not recognized!"
73 tmpd=$(mktemp -d "${TMPDIR:-/tmp}/relXXXXXX")
75 spec=${spec%.spec}.spec
76 rel=$(get_release "$spec")
77 if [ "$inc" = 1 ]; then
79 set_release "$spec" $rel
82 rel=$(get_release "$spec")
84 echo "$spec" >> "$tmpd/$rel"
87 for file in $(ls "$tmpd" 2>/dev/null); do
88 files=$(cat "$tmpd/$file")
89 rel=$(basename "$file")
90 msg="- rel $rel${message:+ ($message)}"
91 echo cvs ci -m "'$msg'"
92 if [ "$test" != 1 ]; then
93 cvs ci -m "$msg" $files