Move Linux client & common packages into a public repo.

This commit is contained in:
Earl Lee
2020-02-05 14:16:58 -08:00
parent c955043dfe
commit a8d8b8719a
156 changed files with 17113 additions and 0 deletions

6
version/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
long.txt
short.txt
version.h
version.xcconfig
ver.go
version

8
version/GENERATE.go Normal file
View File

@@ -0,0 +1,8 @@
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Placeholder that indicates this directory is a valid go package,
// but that redo must 'redo all' in this directory before it can
// be imported.
package version

2
version/all.do Normal file
View File

@@ -0,0 +1,2 @@
redo-ifchange ver.go version.xcconfig version.h

1
version/clean.do Normal file
View File

@@ -0,0 +1 @@
rm -f *~ .*~ long.txt short.txt version.xcconfig ver.go version.h version

10
version/long.txt.do Normal file
View File

@@ -0,0 +1,10 @@
ver=$(git describe | sed 's/^v//')
if [ "$ver" = "${ver%-*}" ]; then
# no sub-version. ie. it's 0.05 and not 0.05-341
# so add a sub-version.
ver=$ver-0
fi
echo "$ver" >$3
redo-always
redo-stamp <$3

18
version/short.txt.do Normal file
View File

@@ -0,0 +1,18 @@
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

8
version/ver.go.do Normal file
View File

@@ -0,0 +1,8 @@
redo-ifchange long.txt short.txt ver.go.in
read -r LONGVER <long.txt
read -r SHORTVER <short.txt
sed -e "s/{LONGVER}/$LONGVER/g" \
-e "s/{SHORTVER}/$SHORTVER/g" \
<ver.go.in >$3

4
version/ver.go.in Normal file
View File

@@ -0,0 +1,4 @@
package version
const LONG = "{LONGVER}"
const SHORT = "{SHORTVER}"

11
version/version.h.do Normal file
View File

@@ -0,0 +1,11 @@
redo-ifchange long.txt short.txt
read -r long <long.txt
read -r short <short.txt
# get it into "major.minor.patch" format
ver=$(echo "$ver" | sed -e 's/-/./')
(
printf '#define TAILSCALE_VERSION_LONG "%s"\n' "$long"
printf '#define TAILSCALE_VERSION_SHORT "%s"\n' "$short"
) >$3

View File

@@ -0,0 +1,17 @@
redo-ifchange short.txt
read -r ver <short.txt
# get it into "major.minor.patch" format
ver=$(echo "$ver" | sed -e 's/-/./')
# CFBundleShortVersionString: the "short name" used in the App Store.
# eg. 0.92.98
echo "VERSION_NAME = $ver" >$3
# CFBundleVersion: the build number. Needs to increment each release.
# start counting at 100 because we submitted using raw build numbers
# before (and Apple doesn't let you start over).
# eg. 100.92.98
major=$((${ver%%.*} + 100))
minor=${ver#*.}
echo "VERSION_ID = $major.$minor" >>$3