Add script for building Qt Creator for packaging

The result is a number of 7zips in the build directory
that can be packaged in an installer, or unzipped
on a different machine directly

Change-Id: Ic1a691678b2268c08e9159c1958dbecefc640fc3
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2020-02-18 13:37:24 +01:00
parent faf7e8f49a
commit 8a18ccdef9
2 changed files with 273 additions and 0 deletions

View File

@@ -40,6 +40,33 @@ def is_linux_platform():
def is_mac_platform():
return sys.platform.startswith('darwin')
def check_print_call(command, workdir):
print('------------------------------------------')
print('COMMAND:')
print(' '.join(['"' + c.replace('"', '\\"') + '"' for c in command]))
print('PWD: "' + workdir + '"')
print('------------------------------------------')
subprocess.check_call(command, cwd=workdir)
def get_git_SHA(path):
try:
return subprocess.check_output(['git', 'rev-list', '-n1', 'HEAD'], cwd=path).strip()
except subprocess.CalledProcessError:
return None
return None
# get commit SHA either directly from git, or from a .tag file in the source directory
def get_commit_SHA(path):
git_sha = get_git_SHA(path)
if not git_sha:
tagfile = os.path.join(path, '.tag')
if os.path.exists(tagfile):
with open(tagfile, 'r') as f:
git_sha = f.read().strip()
return git_sha
# copy of shutil.copytree that does not bail out if the target directory already exists
# and that does not create empty directories
def copytree(src, dst, symlinks=False, ignore=None):