14 test -n "$TDIR" && cd $TDIR
16 CHANGESFILE="package/libzypp.changes"
17 test -f "$CHANGESFILE" || errexit "No changes file '$CHANGESFILE'"
19 VERSIONFILE="VERSION.cmake"
20 test -f "$VERSIONFILE" || errexit "No version file '$VERSIONFILE'"
27 Usage: $(basename $0) [OPTIONS]
28 Options: -h,-?,--help This page.
30 $(basename $0) will load the changes file '$CHANGESFILE'
31 into your editor (\$EDITOR=$EDITOR), providing a new changes
34 -------------------------------------------------------------------
35 Wed Jul 30 18:20:06 CEST 2008 ma@suse.de
39 #---delete-or-release---# LAST RELEASED: 5.3.2 (2) NEW RELEASE: 5.4.0 (4)
41 The revision number is a guess and assumes you will check in to
42 SVN shortly after editing (current server revision + 1).
44 The line '#---delete-or-release---#...' shows the last version submitted
45 to autobuild ('# LAST RELEASED:; tag in $VERSIONFILE). And also the current
46 version, asuming you already updated the $VERSIONFILE according to your changes.
47 (The number in parenthesis is LIBZYPP_COMPATMINOR)
50 - Delete the line if you don't want to submit the package to autobuild.
52 - Leave the line in place if you want to submit the package.
55 Closing the editor you are prompted:
57 #---delete-or-release---# LAST RELEASED: 5.3.2 (2) NEW RELEASE: 5.4.0 (4)
58 (a)bort, (c)ontinue, (e)dit :
60 Choosing (c)ontinue will write the new changes file. The '#---delete-or-release---#'
61 line is missing in case you deleted it. It's presence will remind you
62 that it is going to be converted into:
66 and the '# LAST RELEASED:; tag in $VERSIONFILE will be updated accordingly.
67 Now check the result, check in your changes, build the package and submit
70 Released by accident? Don't mind. Nothing bad will happen. If you want to
71 undo the change, restore the 'LAST RELEASED: ' entry in $VERSIONFILE and
72 delete the '- version' line in $CHANGESFILE'.
87 function getversion() {
94 /^ *SET *\( *LIBZYPP_MAJOR *"[0-9]+" *\)/ {getnum();major=$0}
95 /^ *SET *\( *LIBZYPP_MINOR *"[0-9]+" *\)/ {getnum();minor=$0}
96 /^ *SET *\( *LIBZYPP_PATCH *"[0-9]+" *\)/ {getnum();patch=$0}
97 /^ *SET *\( *LIBZYPP_COMPATMINOR *"[0-9]+" *\)/ {getnum();compatminor=$0}
98 /^# LAST RELEASED:/ {gsub("^.*RELEASED: *","");gsub(" +$","");gsub(" +\\("," (");lastrelease=$0}
100 thisrelease = major"."minor"."patch" ("compatminor")"
101 if ( thisrelease == lastrelease )
102 print "#---delete-or-release---# LAST RELEASED: "lastrelease" UNCHANGED RELEASE: "thisrelease
104 print "#---delete-or-release---# LAST RELEASED: "lastrelease" NEW RELEASE: "thisrelease
109 function nextrevision() {
110 svn status -u CMakeLists.txt \
111 | awk '/^Status against revision:/{print $4+1}'
114 VERSIONNUMBER="$(getversion)"
116 test -r /etc/sysconfig/mail && source /etc/sysconfig/mail
117 EMAIL="${USER}@${FROM_HEADER:-$(hostname -f)}"
123 echo "-------------------------------------------------------------------"
124 echo "$(date) $EMAIL"
127 echo "- revision $(nextrevision)"
134 while [ "$RES" == "e" ]; do
137 NEWREL=$(grep '#---delete-or-release---#' $TMPFILE)
138 test -n "$NEWREL" && echo "$NEWREL"
139 read -n 1 -p "(a)bort, (c)ontinue, (e)dit : " RES
146 test -n "$NEWREL" && {
147 echo "Remember new release in $VERSIONFILE"
148 sed -i 's/^.*#---delete-or-release---#.*RELEASE:/- version/' $TMPFILE
149 NEWREL=$(sed 's/^.*#---delete-or-release---#.*RELEASE:/# LAST RELEASED:/' <<<"$NEWREL")
150 sed -i "s/^# LAST RELEASED:.*$/$NEWREL/" $VERSIONFILE
153 echo "Store new $CHANGESFILE"
154 cp $TMPFILE $CHANGESFILE
157 | awk '{print}/----------/{n=n+1; if ( n == 2 ) exit 0; }'
160 echo "Leave $CHANGESFILE untouched"