14 test -n "$TDIR" && cd $TDIR
16 CHANGESFILE=$(ls package/*.changes)
17 test -f "$CHANGESFILE" || errexit "No changes file '$CHANGESFILE'"
19 VERSIONFILE="VERSION.cmake"
20 test -f "$VERSIONFILE" || errexit "No version file '$VERSIONFILE'"
24 ## Version.cmake tags in getversion() are still zypp specific.
30 Usage: $(basename $0) [OPTIONS]
31 Options: -h,-?,--help This page.
33 $(basename $0) will load the changes file '$CHANGESFILE'
34 into your editor (\$EDITOR=$EDITOR), providing a new changes
37 -------------------------------------------------------------------
38 Wed Jul 30 18:20:06 CEST 2008 - ma@suse.de
41 #---delete-or-release---# LAST RELEASED: 5.3.2 (2) NEW RELEASE: 5.4.0 (4)
43 The line '#---delete-or-release---#...' shows the last version submitted
44 to autobuild ('# LAST RELEASED:; tag in $VERSIONFILE). And also the current
45 version, asuming you already updated the $VERSIONFILE according to your changes.
46 (The number in parenthesis is _COMPATMINOR)
49 - Delete the line if you don't want to submit the package to autobuild.
51 - Leave the line in place if you want to submit the package.
54 Closing the editor you are prompted:
56 #---delete-or-release---# LAST RELEASED: 5.3.2 (2) NEW RELEASE: 5.4.0 (4)
57 (a)bort, (c)ontinue, (e)dit :
59 Choosing (c)ontinue will write the new changes file. The '#---delete-or-release---#'
60 line is missing in case you deleted it. It's presence will remind you
61 that it is going to be converted into:
65 and the '# LAST RELEASED:; tag in $VERSIONFILE will be updated accordingly.
66 Now check the result, check in your changes, build the package and submit
69 Released by accident? Don't mind. Nothing bad will happen. If you want to
70 undo the change, restore the 'LAST RELEASED: ' entry in $VERSIONFILE and
71 delete the '- version' line in $CHANGESFILE'.
86 function getversion() {
93 /^ *SET *\( *LIBZYPP_MAJOR *"[0-9]+" *\)/ {getnum();major=$0}
94 /^ *SET *\( *LIBZYPP_MINOR *"[0-9]+" *\)/ {getnum();minor=$0}
95 /^ *SET *\( *LIBZYPP_PATCH *"[0-9]+" *\)/ {getnum();patch=$0}
96 /^ *SET *\( *LIBZYPP_COMPATMINOR *"[0-9]+" *\)/ {getnum();compatminor=$0}
97 /^# LAST RELEASED:/ {gsub("^.*RELEASED: *","");gsub(" +$","");gsub(" +\\("," (");lastrelease=$0}
99 thisrelease = major"."minor"."patch" ("compatminor")"
100 if ( thisrelease == lastrelease )
101 print "#---delete-or-release---# LAST RELEASED: "lastrelease" UNCHANGED RELEASE: "thisrelease
103 print "#---delete-or-release---# LAST RELEASED: "lastrelease" NEW RELEASE: "thisrelease
108 test -r /etc/sysconfig/mail && source /etc/sysconfig/mail
109 EMAIL="${USER}@${FROM_HEADER:-$(hostname -f)}"
111 GOTVERSION="$(getversion)"
116 echo "-------------------------------------------------------------------"
117 echo "$(date) - $EMAIL"
126 while [ "$RES" == "e" ]; do
129 NEWREL=$(grep '#---delete-or-release---#' $TMPFILE)
130 test -n "$NEWREL" && echo "$NEWREL"
131 read -n 1 -p "(a)bort, (c)ontinue, (e)dit : " RES
139 test -n "$NEWREL" && {
140 echo "Remember new release in $VERSIONFILE"
141 sed -i 's/^.*#---delete-or-release---#.*RELEASE:/- version/' $TMPFILE
142 NEWREL=$(sed 's/^.*#---delete-or-release---#.*RELEASE:/# LAST RELEASED:/' <<<"$NEWREL")
143 sed -i "s/^# LAST RELEASED:.*$/$NEWREL/" $VERSIONFILE
146 echo "Store new $CHANGESFILE"
147 cp $TMPFILE $CHANGESFILE
149 echo "$(sed 's/^.*#---delete-or-release---#.*RELEASE:/# CURRENT RELEASE:/' <<<"$GOTVERSION")"
150 awk '{print}/^----------/{n=n+1; if ( n == 2 ) exit 0; }' $CHANGESFILE
154 echo "Leave $CHANGESFILE untouched"