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