summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/make-tarball9
-rwxr-xr-xtools/read-version17
2 files changed, 6 insertions, 20 deletions
diff --git a/tools/make-tarball b/tools/make-tarball
index 57358447..d8705896 100755
--- a/tools/make-tarball
+++ b/tools/make-tarball
@@ -35,14 +35,7 @@ while [ $# -ne 0 ]; do
done
rev=${1:-HEAD}
-git_describe=$(git describe ${long_opt} $rev)
-
-# git_describe could be 0.7.5 or 0.7.5-NNN-gHASH
-# turn that into 0.7.5 or 0.7.5+NNN.gHASH
-case "$git_describe" in
- *-*) version=$(echo "$git_describe" | sed -e 's/-/+/' -e 's/-/./');;
- *) version=${git_describe};;
-esac
+version=$(git describe ${long_opt} $rev)
archive_base="cloud-init-$version"
if [ -z "$output" ]; then
diff --git a/tools/read-version b/tools/read-version
index 78e34157..85c62343 100755
--- a/tools/read-version
+++ b/tools/read-version
@@ -34,26 +34,19 @@ src_version = ci_version.version_string()
version_long = None
if os.path.isdir(os.path.join(_tdir, ".git")):
- def fix_git_version(ver):
- ver = ver.strip()
- if "-" in ver:
- # change X.Y.Z-1023-gHASH to X.Y.Z+1023.ghash
- return "{0}+{1}.{2}".format(*ver.split("-"))
- return ver
-
flags = []
if use_tags:
flags = ['--tags']
cmd = ['git', 'describe'] + flags
- version = fix_git_version(tiny_p(cmd))
+ version = tiny_p(cmd).strip()
if not version.startswith(src_version):
sys.stderr.write("git describe version (%s) differs from "
"cloudinit.version (%s)\n" % (version, src_version))
sys.exit(1)
- version_long = fix_git_version(tiny_p(cmd + ["--long"]))
+ version_long = tiny_p(cmd + ["--long"]).strip()
else:
version = src_version
version_long = None
@@ -66,9 +59,9 @@ commit = None
distance = None
if version_long:
- info = version_long.partition("+")[2]
- extra = "+" + info
- distance, commit = info.split(".")
+ info = version_long.partition("-")[2]
+ extra = "-" + info
+ distance, commit = info.split("-")
# remove the 'g' from gHASH
commit = commit[1:]