summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-10-05 14:21:00 -0400
committerScott Moser <smoser@brickies.net>2017-10-05 14:21:00 -0400
commit6eb4dc24fe314ce5c98b05b21988402cda95afce (patch)
tree9df113a11891b89a1197e978e23ecaba217465a6
parent57e2e01c703cdd1818d4f4ab8a67f37037d78582 (diff)
downloadvyos-cloud-init-6eb4dc24fe314ce5c98b05b21988402cda95afce.tar.gz
vyos-cloud-init-6eb4dc24fe314ce5c98b05b21988402cda95afce.zip
tools: Give specific --abbrev=8 to "git describe"
The tools that use "git describe" were just assuming a consisent number of characters in the hash. It seems ubuntu 16.04 would use 7 and later versions use 8. To avoid that discrepency in developer environments, set it to 8.
-rwxr-xr-xtools/make-tarball2
-rwxr-xr-xtools/read-version2
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/make-tarball b/tools/make-tarball
index 91c45624..3197689f 100755
--- a/tools/make-tarball
+++ b/tools/make-tarball
@@ -35,7 +35,7 @@ while [ $# -ne 0 ]; do
done
rev=${1:-HEAD}
-version=$(git describe "--match=[0-9]*" ${long_opt} $rev)
+version=$(git describe --abbrev=8 "--match=[0-9]*" ${long_opt} $rev)
archive_base="cloud-init-$version"
if [ -z "$output" ]; then
diff --git a/tools/read-version b/tools/read-version
index ddb28383..d9ed30da 100755
--- a/tools/read-version
+++ b/tools/read-version
@@ -56,7 +56,7 @@ if os.path.isdir(os.path.join(_tdir, ".git")) and which("git"):
flags = []
if use_tags:
flags = ['--tags']
- cmd = ['git', 'describe', '--match=[0-9]*'] + flags
+ cmd = ['git', 'describe', '--abbrev=8', '--match=[0-9]*'] + flags
version = tiny_p(cmd).strip()