ef3f20
From 13d7d4bf4a94b8cc95beccee0aad96d73d246acf Mon Sep 17 00:00:00 2001
ef3f20
From: Lars Kellogg-Stedman <lars@redhat.com>
ef3f20
Date: Thu, 12 Jan 2017 16:21:10 -0500
ef3f20
Subject: [PATCH] do not use git to determine version
ef3f20
ef3f20
trying to use git to determine the current cloud-init version will
ef3f20
fail when building the package.
ef3f20
ef3f20
X-downstream-only: true
ef3f20
---
ef3f20
 tools/read-version | 19 ++-----------------
ef3f20
 1 file changed, 2 insertions(+), 17 deletions(-)
ef3f20
ef3f20
diff --git a/tools/read-version b/tools/read-version
ef3f20
index 3b30b49..1ce3ac6 100755
ef3f20
--- a/tools/read-version
ef3f20
+++ b/tools/read-version
ef3f20
@@ -52,23 +52,8 @@ output_json = '--json' in sys.argv
ef3f20
 src_version = ci_version.version_string()
ef3f20
 version_long = None
ef3f20
 
ef3f20
-if os.path.isdir(os.path.join(_tdir, ".git")) and which("git"):
ef3f20
-    flags = []
ef3f20
-    if use_tags:
ef3f20
-        flags = ['--tags']
ef3f20
-    cmd = ['git', 'describe'] + flags
ef3f20
-
ef3f20
-    version = tiny_p(cmd).strip()
ef3f20
-
ef3f20
-    if not version.startswith(src_version):
ef3f20
-        sys.stderr.write("git describe version (%s) differs from "
ef3f20
-                         "cloudinit.version (%s)\n" % (version, src_version))
ef3f20
-        sys.exit(1)
ef3f20
-
ef3f20
-    version_long = tiny_p(cmd + ["--long"]).strip()
ef3f20
-else:
ef3f20
-    version = src_version
ef3f20
-    version_long = None
ef3f20
+version = src_version
ef3f20
+version_long = None
ef3f20
 
ef3f20
 # version is X.Y.Z[+xxx.gHASH]
ef3f20
 # version_long is None or X.Y.Z-xxx-gHASH