version: greatly simplify redo nonsense, now that we use VERSION.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-11-02 18:08:47 -08:00
committed by Dave Anderson
parent 20a357b386
commit 65bad9a8bd
13 changed files with 208 additions and 265 deletions
+7 -15
View File
@@ -1,17 +1,9 @@
redo-ifchange long.txt short.txt
read -r long <long.txt
read -r short <short.txt
redo-ifchange version-info.sh
# get it into "major.minor.patch" format
ver=$(echo "$ver" | sed -e 's/-/./')
. ./version-info.sh
# winres is the MAJOR,MINOR,BUILD,REVISION 4-tuple used to identify
# the version of Windows binaries. We always set REVISION to 0, which
# seems to be how you map SemVer.
winres=$(echo "$short,0" | sed -e 's/\./,/g')
(
printf '#define TAILSCALE_VERSION_LONG "%s"\n' "$long"
printf '#define TAILSCALE_VERSION_SHORT "%s"\n' "$short"
printf '#define TAILSCALE_VERSION_WIN_RES %s\n' "$winres"
) >$3
cat >$3 <<EOF
#define TAILSCALE_VERSION_LONG "$VERSION_LONG"
#define TAILSCALE_VERSION_SHORT "$VERSION_SHORT"
#define TAILSCALE_VERSION_WIN_RES $VERSION_WINRES
EOF