diff options
author | Kim Hagen <kim.sidney@gmail.com> | 2018-10-21 22:50:43 +0200 |
---|---|---|
committer | Kim Hagen <kim.sidney@gmail.com> | 2018-10-21 22:50:43 +0200 |
commit | c6596d86435fdb1933a7755de110e8f6e8de6aaf (patch) | |
tree | a537b7f8d4dc597bd4d87a936b63fba610ed98b3 /tools | |
parent | acb53fd6ea1ab907f86c877f509dbfee5d06cce6 (diff) | |
download | vyos-cloud-init-c6596d86435fdb1933a7755de110e8f6e8de6aaf.tar.gz vyos-cloud-init-c6596d86435fdb1933a7755de110e8f6e8de6aaf.zip |
do not check git
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/read-version | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/tools/read-version b/tools/read-version index 3ea9e66e..06fd61a8 100755 --- a/tools/read-version +++ b/tools/read-version @@ -45,43 +45,14 @@ def which(program): return None -def is_gitdir(path): - # Return boolean indicating if path is a git tree. - git_meta = os.path.join(path, '.git') - if os.path.isdir(git_meta): - return True - if os.path.exists(git_meta): - # in a git worktree, .git is a file with 'gitdir: x' - with open(git_meta, "rb") as fp: - if b'gitdir:' in fp.read(): - return True - return False - - use_long = '--long' in sys.argv or os.environ.get('CI_RV_LONG') use_tags = '--tags' in sys.argv or os.environ.get('CI_RV_TAGS') output_json = '--json' in sys.argv src_version = ci_version.version_string() version_long = None - -if is_gitdir(_tdir) and which("git"): - flags = [] - if use_tags: - flags = ['--tags'] - cmd = ['git', 'describe', '--abbrev=8', '--match=[0-9]*'] + flags - - 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 = tiny_p(cmd + ["--long"]).strip() -else: - version = src_version - version_long = None +version = src_version +version_long = None # version is X.Y.Z[+xxx.gHASH] # version_long is None or X.Y.Z-xxx-gHASH |