summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2013-08-23 00:35:12 +0200
committerAndoni Morales Alastruey <ylatuya@gmail.com>2013-08-23 00:37:32 +0200
commit418d54ea87b70ae547f27db6ed004cae8b0ab4fa (patch)
treef4ad4f1984c42a0c0e0a6dc0bd319754160be647
parent420fecc3030ff73b154b914793803aa4fcdfab21 (diff)
strip: add properties to select the dirs to strip
-rw-r--r--cerbero/packages/osx/packager.py9
-rw-r--r--cerbero/packages/package.py6
-rw-r--r--cerbero/packages/wix_packager.py6
-rw-r--r--cerbero/tools/strip.py9
4 files changed, 20 insertions, 10 deletions
diff --git a/cerbero/packages/osx/packager.py b/cerbero/packages/osx/packager.py
index 7fd0dda..77fd734 100644
--- a/cerbero/packages/osx/packager.py
+++ b/cerbero/packages/osx/packager.py
@@ -394,11 +394,10 @@ class ApplicationPackage(PackagerBase):
def _strip_binaries(self):
if self.package.strip:
- bin_dir = os.path.join(self.appdir, 'Contents', 'Home', 'bin')
- lib_dir = os.path.join(self.appdir, 'Contents', 'Home', 'lib')
- s = strip.Strip(self.config)
- s.strip_dir(bin_dir)
- s.strip_dir(lib_dir)
+ for f in self.package.strip_dirs:
+ s_dir = os.path.join(self.appdir, 'Contents', 'Home', f)
+ s = strip.Strip(self.config, self.excludes)
+ s.strip_dir(s_dir)
def _relocate_binaries(self):
prefix = self.config.prefix
diff --git a/cerbero/packages/package.py b/cerbero/packages/package.py
index d91a78b..5914463 100644
--- a/cerbero/packages/package.py
+++ b/cerbero/packages/package.py
@@ -482,6 +482,10 @@ class App(PackageBase):
@type wrapper: str
@cvar strip: strip binaries for this package
@type strip: bool
+ @cvar strip_dirs: directories to strip
+ @type strip: list
+ @cvar strip_excludes: files that won't be stripped
+ @type strip_excludes: list
'''
app_name = None
@@ -492,6 +496,8 @@ class App(PackageBase):
wrapper = 'app_wrapper.tpl'
resources_wix_installer = None
strip = False
+ strip_dirs = ['bin']
+ strip_excludes = []
def __init__(self, config, store, cookbook):
PackageBase.__init__(self, config, store)
diff --git a/cerbero/packages/wix_packager.py b/cerbero/packages/wix_packager.py
index 991c87f..fc1b0a6 100644
--- a/cerbero/packages/wix_packager.py
+++ b/cerbero/packages/wix_packager.py
@@ -75,9 +75,9 @@ class MergeModulePackager(PackagerBase):
if not os.path.exists(os.path.dirname(dst)):
os.makedirs(os.path.dirname(dst))
shutil.copy(src, dst)
- s = strip.Strip(self.config)
- s.strip_dir(os.path.join(tmpdir, 'bin'))
- s.strip_dir(os.path.join(tmpdir, 'lib'))
+ s = strip.Strip(self.config, self.package.strip_excludes)
+ for p in self.package.strip_dirs:
+ s.strip_dir(os.path.join(tmpdir, p))
mergemodule = MergeModule(self.config, files_list, self.package)
diff --git a/cerbero/tools/strip.py b/cerbero/tools/strip.py
index c8f1ef9..f37fcfb 100644
--- a/cerbero/tools/strip.py
+++ b/cerbero/tools/strip.py
@@ -24,12 +24,17 @@ from cerbero.utils import shell
class Strip(object):
'''Wrapper for the strip tool'''
- STRIP_CMD = 'strip'
+ STRIP_CMD = '$STRIP'
+ excludes = None
- def __init__(self, config):
+ def __init__(self, config, excludes):
self.config = config
+ self.excludes = excludes
def strip_file(self, path):
+ for f in self.excludes:
+ if f in path:
+ return
try:
shell.call("%s %s". self._strip_cmd(), path)
except: