3 # showusage is set to 1 on any command-line syntax error
5 # are we playing by stable or dev rules?
7 # test is set to 1 if -t/--test is given to prevent modifications
33 *) echo "Unexpected repo type: <$repo>!"
39 1) echo "Usage: $0 [-t] <stable|dev>"
40 echo "No changes are made to packageinfo.sh if -t is given."
53 *) echo "You indicated repo type <$repo> but packageinfo.sh"
54 echo "indicates <$repotype>."
82 case "$ver_repo_mismatch" in
83 1) echo "Minor version <$minor> mismatches repotype <$repo>."
88 # Do we want to bump the point?
90 # Do we want to bump the beta point?
92 # Do we want to change the RC point? (n=no, z=empty rcpoint and zero
95 # Do we want to change the prerelease value?
99 # if we are not in a beta or RC state, enter beta unless point is NEW.
100 # if we are in a beta state:
101 # - bump the beta point
102 # else if we are in an RC state:
103 # - if rcpoint is GO:
104 # - - set rcpoint= (empty)
105 # - - set prerelease= (empty)
106 # - - set betapoint=0
108 # - - if rcpoint==(empty)
109 # - - - (bump-point) and set rcpoint to 0 (and fall thru, so -RC1 is first)
110 # - - bump the RC point
112 # for dev, we only want to bump-point and possibly clear prerelease,
113 # but we do not modify rcpoint nor betapoint.
128 case "$prerelease" in
130 case "$betapoint::$rcpoint::$point" in
132 # new minor release (no p)
137 # start of first beta cycle for the next point release
144 # skip all -beta and -RC prereleases to the next point.
151 *) echo "betapoint is <$betapoint>, rcpoint is <$rcpoint>"
152 echo "betapoint must be 0 and rcpoint must be empty to start the"
159 case "$betapoint::$rcpoint" in
164 0::) echo "betapoint is 0, rcpoint emtpy, and prerelease is beta."
165 echo "You probably intended prerelease= (that is, empty). It"
166 echo "will then be changed to beta by this script, starting the"
167 echo "first beta for the next point release."
177 echo "prerelease is beta, rcpoint is GO, disallowed."
178 echo "rcpoint GO is allowed only when prerelease is RC or empty."
204 *) echo "Unexpected value for 'rcpoint' <$rcpoint>!"
210 echo "prerelease <$prerelease> unexpected"
215 *) echo "impossible: repo <$repo>!"
220 case "$repo::$bp::$point" in
225 newpoint=`expr $point + 1`
228 newpoint=`expr $point + 1`
239 *) echo "Unexpected value for 'point' <$point>! (repo::bp::point is $repo::$bp::$point)"
244 case "$bbp::$betapoint" in
246 newbetapoint=$betapoint
249 newbetapoint=`expr $betapoint + 1`
251 *) echo "Unexpected value for 'betapoint' <$betapoint>!"
256 case "$crcp::$rcpoint" in
264 newrcpoint=`expr $rcpoint + 1`
270 *) echo "Unexpected value for 'crcp::rcpoint' <$crcp::$rcpoint>!"
281 printf "prerelease $prerelease"
286 *) printf " -> $newpr\n"
289 printf "point $point"
294 *) printf " -> $newpoint\n"
297 printf "betapoint $betapoint"
298 case "$newbetapoint" in
302 *) printf " -> $newbetapoint\n"
305 printf "rcpoint $rcpoint"
306 case "$newrcpoint" in
310 *) printf " -> $newrcpoint\n"
314 printf "Previous version: "
315 scripts/build/VersionName
317 # apply packageinfo.sh changes
319 sed -e "s/^point=.*/point=$newpoint/" \
320 -e "s/^betapoint=.*/betapoint=$newbetapoint/" \
321 -e "s/^rcpoint=.*/rcpoint=$newrcpoint/" \
322 -e "s/^prerelease=.*/prerelease=$newpr/" \
328 mv packageinfo.sh+ packageinfo.sh
329 printf "Updated version: "
330 scripts/build/VersionName
333 printf "Next version would be: "
334 scripts/build/VersionName -p ./packageinfo.sh+