Do not invoke `git` when installing a build (amend f935324)

This commit is contained in:
Robin Gareus 2022-05-17 17:49:03 +02:00
parent 6f973e09d1
commit 6f7adbda59
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 6 additions and 3 deletions

View File

@ -187,7 +187,7 @@ def fetch_tarball_revision_date():
return rev, date
def set_version ():
def set_version (from_file = False):
def sanitize(s):
# round-trip to remove anything in the string that is not encodable in
# ASCII, yet still keep a real (utf8-encoded internally) string.
@ -215,7 +215,7 @@ def set_version ():
global PROGRAM_VERSION
global rev_date
if os.path.isdir (os.path.join(os.getcwd(), '.git')):
if not from_file and os.path.isdir (os.path.join(os.getcwd(), '.git')):
rev, rev_date = fetch_git_revision_date()
else:
rev, rev_date = fetch_tarball_revision_date()
@ -1539,7 +1539,10 @@ const char* const ardour_config_info = "\\n\\
create_resource_file(Options.options.program_name)
def build(bld):
create_stored_revision()
if bld.is_install:
set_version (True)
else:
create_stored_revision()
bld.env['DATE'] = rev_date