aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2015-10-09 11:46:14 +0200
committerEike Ziller <eike.ziller@theqtcompany.com>2015-10-09 11:33:21 +0000
commit57ae75061da05b6526987f3f7183ed387a292c97 (patch)
treed2057152d1ae21c34fefd609e50e30d8ae6faacc /scripts
parent9a69a05f9b22d6851535e02c8db47f3a1c4ea4ea (diff)
Allow packaging additional 7zips in the installer
Change-Id: I435602671ef5cde46580d4ca383930951765ebde Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/packageIfw.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/scripts/packageIfw.py b/scripts/packageIfw.py
index 67aba26a5e..0d7581d2f1 100755
--- a/scripts/packageIfw.py
+++ b/scripts/packageIfw.py
@@ -38,7 +38,7 @@ import shutil
import inspect
def usage():
- print('Usage: %s [-v|--version-string=versionstring] [-i|--installer-path=/path/to/installerfw] [-a|--archive=archive.7z] <outputname>' % os.path.basename(sys.argv[0]))
+ print('Usage: %s [-v|--version-string=versionstring] [-i|--installer-path=/path/to/installerfw] [-a|--archive=archive.7z] [-d|--debug] <outputname>' % os.path.basename(sys.argv[0]))
def substitute_file(infile, outfile, substitutions):
with open(infile, 'r') as f:
@@ -53,7 +53,7 @@ def ifw_template_dir():
def main():
try:
- opts, args = getopt.gnu_getopt(sys.argv[1:], 'hv:i:a:', ['help', 'version-string=', 'installer-path=', 'archive'])
+ opts, args = getopt.gnu_getopt(sys.argv[1:], 'hv:i:a:d', ['help', 'version-string=', 'installer-path=', 'archive', 'debug'])
except:
usage()
sys.exit(2)
@@ -64,7 +64,8 @@ def main():
version = ''
ifw_location = ''
- archive = ''
+ archives = []
+ debug = False
for o, a in opts:
if o in ('-h', '--help'):
usage()
@@ -74,7 +75,9 @@ def main():
if o in ('-i', '--installer-path'):
ifw_location = a
if o in ('-a', '--archive'):
- archive = a
+ archives.append(a)
+ if o in ('-d', '--debug'):
+ debug = True
if (version == ''):
raise Exception('Version not specified (--version-string)!')
@@ -82,8 +85,8 @@ def main():
if (ifw_location == ''):
raise Exception('Installer framework location not specified (--installer-path)!')
- if (archive == ''):
- raise Exception('Archive not specified (--archive)!')
+ if not archives:
+ raise ValueError('No archive(s) specified (--archive)!')
installer_name = args[0]
config_postfix = ''
@@ -100,12 +103,15 @@ def main():
try:
temp_dir = tempfile.mkdtemp()
except:
- raise Exception('Failed to create a temporary directory!')
+ raise IOError('Failed to create a temporary directory!')
+ if debug:
+ print('Working directory: {0}'.format(temp_dir))
try:
substs = {}
substs['version'] = version
substs['date'] = datetime.date.today().isoformat()
+ substs['archives'] = ','.join(archives)
template_dir = ifw_template_dir()
out_config_dir = os.path.join(temp_dir,'config')
@@ -127,13 +133,17 @@ def main():
data_path = os.path.join(out_packages_dir, 'org.qtproject.qtcreator.application', 'data')
if not os.path.exists(data_path):
os.makedirs(data_path)
- shutil.copy(archive, data_path)
+ for archive in archives:
+ shutil.copy(archive, data_path)
ifw_call = [os.path.join(ifw_location, 'bin', 'binarycreator'), '-c', os.path.join(out_config_dir, config_name), '-p', out_packages_dir, installer_name, '--offline-only' ]
+ if debug:
+ ifw_call.append('-v')
subprocess.check_call(ifw_call, stderr=subprocess.STDOUT)
finally:
- print('Cleaning up...')
- shutil.rmtree(temp_dir)
+ if not debug:
+ print('Cleaning up...')
+ shutil.rmtree(temp_dir)
print('Done.')
if __name__ == '__main__':