summaryrefslogtreecommitdiff
path: root/scripts/common.py
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-01-22 12:53:35 +0100
committerEike Ziller <eike.ziller@qt.io>2018-01-23 12:21:49 +0000
commitb88bfe7db30aa4dd78568e8de2d1167aaee925fd (patch)
tree99d7613ab37c3b81e98c055ed3b7cf7554717c57 /scripts/common.py
parentfdb95299c67b195d46cd3b7a37ed5118809e9a57 (diff)
downloadqt-creator-b88bfe7db30aa4dd78568e8de2d1167aaee925fd.tar.gz
Filter debug info out when creating macOS disk image
Move the script to Python for that, for code sharing Change-Id: I1a0b1ed7fe3ed4413045d478c82621d75800520e Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'scripts/common.py')
-rw-r--r--scripts/common.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/common.py b/scripts/common.py
index 388ce487fd..b8f640377e 100644
--- a/scripts/common.py
+++ b/scripts/common.py
@@ -163,3 +163,17 @@ def fix_rpaths(path, qt_deploy_path, qt_install_info, chrpath=None):
if is_unix_executable(filepath) or is_unix_library(filepath):
fix_rpaths_helper(filepath)
+def is_debug_file(filepath):
+ if is_mac_platform():
+ return filepath.endswith('.dSYM') or '.dSYM/' in filepath
+ elif is_linux_platform():
+ return filepath.endswith('.debug')
+ else:
+ return filepath.endswith('.pdb')
+
+def is_debug(path, filenames):
+ return [fn for fn in filenames if is_debug_file(os.path.join(path, fn))]
+
+def is_not_debug(path, filenames):
+ files = [fn for fn in filenames if os.path.isfile(os.path.join(path, fn))]
+ return [fn for fn in files if not is_debug_file(os.path.join(path, fn))]