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'"
22 ## Version.cmake tags in getversion() are still zypp specific.
28 Usage: $(basename $0) [OPTIONS]
29 Options: -h,-?,--help This page.
31 $(basename $0) will load the changes file '$CHANGESFILE'
32 into your editor (\$EDITOR=$EDITOR), providing a new changes
35 -------------------------------------------------------------------
36 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 line '#---delete-or-release---#...' shows the last version submitted
42 to autobuild ('# LAST RELEASED:; tag in $VERSIONFILE). And also the current
43 version, asuming you already updated the $VERSIONFILE according to your changes.
44 (The number in parenthesis is _COMPATMINOR)
47 - Delete the line if you don't want to submit the package to autobuild.
49 - Leave the line in place if you want to submit the package.
52 Closing the editor you are prompted:
54 #---delete-or-release---# LAST RELEASED: 5.3.2 (2) NEW RELEASE: 5.4.0 (4)
55 (a)bort, (c)ontinue, (e)dit :
57 Choosing (c)ontinue will write the new changes file. The '#---delete-or-release---#'
58 line is missing in case you deleted it. It's presence will remind you
59 that it is going to be converted into:
63 and the '# LAST RELEASED:; tag in $VERSIONFILE will be updated accordingly.
64 Now check the result, check in your changes, build the package and submit
67 Released by accident? Don't mind. Nothing bad will happen. If you want to
68 undo the change, restore the 'LAST RELEASED: ' entry in $VERSIONFILE and
69 delete the '- version' line in $CHANGESFILE'.
84 function getversion() {
91 /^ *SET *\( *LIBZYPP_MAJOR *"[0-9]+" *\)/ {getnum();major=$0}
92 /^ *SET *\( *LIBZYPP_MINOR *"[0-9]+" *\)/ {getnum();minor=$0}
93 /^ *SET *\( *LIBZYPP_PATCH *"[0-9]+" *\)/ {getnum();patch=$0}
94 /^ *SET *\( *LIBZYPP_COMPATMINOR *"[0-9]+" *\)/ {getnum();compatminor=$0}
95 /^# LAST RELEASED:/ {gsub("^.*RELEASED: *","");gsub(" +$","");gsub(" +\\("," (");lastrelease=$0}
97 thisrelease = major"."minor"."patch" ("compatminor")"
98 if ( thisrelease == lastrelease )
99 print "#---delete-or-release---# LAST RELEASED: "lastrelease" UNCHANGED RELEASE: "thisrelease
101 print "#---delete-or-release---# LAST RELEASED: "lastrelease" NEW RELEASE: "thisrelease
106 test -r /etc/sysconfig/mail && source /etc/sysconfig/mail
107 EMAIL="${USER}@${FROM_HEADER:-$(hostname -f)}"
109 GOTVERSION="$(getversion)"
114 echo "-------------------------------------------------------------------"
115 echo "$(date) - $EMAIL"
124 while [ "$RES" == "e" ]; do
127 NEWREL=$(grep '#---delete-or-release---#' $TMPFILE)
128 test -n "$NEWREL" && echo "$NEWREL"
129 read -n 1 -p "(a)bort, (c)ontinue, (e)dit : " RES
137 test -n "$NEWREL" && {
138 echo "Remember new release in $VERSIONFILE"
139 sed -i 's/^.*#---delete-or-release---#.*RELEASE:/- version/' $TMPFILE
140 NEWREL=$(sed 's/^.*#---delete-or-release---#.*RELEASE:/# LAST RELEASED:/' <<<"$NEWREL")
141 sed -i "s/^# LAST RELEASED:.*$/$NEWREL/" $VERSIONFILE
144 echo "Store new $CHANGESFILE"
145 cp $TMPFILE $CHANGESFILE
147 echo "$(sed 's/^.*#---delete-or-release---#.*RELEASE:/# CURRENT RELEASE:/' <<<"$GOTVERSION")"
148 awk '{print}/^----------/{n=n+1; if ( n == 2 ) exit 0; }' $CHANGESFILE
152 echo "Leave $CHANGESFILE untouched"