version: support major.minor.patch tags without breaking Apple builds.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-06-01 20:42:34 +00:00
committed by Dave Anderson
parent 984a699219
commit 5aae6b734d
8 changed files with 167 additions and 45 deletions
+4 -18
View File
@@ -1,18 +1,4 @@
redo-ifchange long.txt
read -r LONGVER junk <long.txt
# Convert a version like "0.92-98-g123456" into "0.92-98".
# Sometimes the version is just "0.92-0", in which case we leave it as is.
case $LONGVER in
*-*-*)
echo "${LONGVER%-*}" >$3
;;
*-*)
echo "$LONGVER" >$3
;;
*)
echo "Fatal: long version in invalid format." >&2
exit 44
esac
redo-stamp <$3
redo-ifchange mkversion.sh describe.txt
read -r describe <describe.txt
ver=$(./mkversion.sh short "$describe")
echo "$ver" >$3