diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/release | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/release b/scripts/release index 62a896a..b88d2a5 100755 --- a/scripts/release +++ b/scripts/release @@ -13,7 +13,8 @@ # 3. This build's `continuum --version` and the last release's (built in # CONTINUUM_RELEASE_TARGET, ~/.cache/continuum/release unless set) say how one upgrades: # node by node where their wire versions meet, else every node together, which takes -# a major release from 1.0.0 on; scripts/wire-check runs a swarm of both and checks +# a major release (before 1.0.0, a raise of the first part that isn't 0, as Cargo reads +# versions); scripts/wire-check runs a swarm of both and checks # they do as said. # 4. CHANGELOG.md's Unreleased notes become VERSION's, under a line saying so; the # commit `release VERSION` holds it all, tagged vVERSION, its message saying how to @@ -42,6 +43,11 @@ die() { say "$*" exit 1 } +# The part of version $1 that only a flag day raises, with the rest as 0: the major one, or +# before 1.0.0 the first that isn't 0, as Cargo reads versions (0.2.0 of 0.2.1). +leading() { + echo "$1" | awk -F. '{ if ($1 > 0) print $1 ".0.0"; else if ($2 > 0) print "0." $2 ".0"; else print "0.0." $3 }' +} cd "$(git rev-parse --show-toplevel)" features=${CONTINUUM_FEATURES:-federation,mycelium} @@ -136,10 +142,8 @@ if [ -n "$last" ]; then upgrade="From $last it rolls out node by node: install it on every node, in any order." else upgrade="From $last every node upgrades together: $why." - major_last=$(echo "${last#v}" | cut -d. -f1) - major_here=$(echo "$version" | cut -d. -f1) - if [ "$major_last" -ge 1 ] && [ "$major_here" -le "$major_last" ]; then - die "$why: from 1.0.0 on, that takes a major release, not $version" + if [ "$(leading "${last#v}")" = "$(leading "$version")" ]; then + die "$why: that takes a major release (before 1.0.0, a new first part that isn't 0), not $version" fi fi say "scripts/wire-check $last" |
