Commits

Anonymous committed 43185e8

Fix for dSYM removal code:

The newest greatest and finest py2app from SVN has two bugs for which I'm supplying a patch:
* it uses shutils, which it does not import
* the dSYM removal function really does delete given files, but the list of files to strip isn't updated, which fails on trying to strip an non-existing file

Patch by Cezary Krzyżanowski

Comments (0)

Files changed (1)

py2app/build_app.py

 import zipfile
 import plistlib
 import shlex
+import shutil
 from cStringIO import StringIO
 
 from setuptools import Command
                     mm.mm.run_file(fmwk)
                 platfiles = mm.run()
                 if self.strip:
-                    self.strip_dsym()
+                    platfiles = self.strip_dsym(platfiles)
                     self.strip_files(platfiles)
             self.app_files.append(dst)
 
                     copy_file(pth, os.path.join(target_dir, fname))
 
 
-    def strip_dsym(self):
+    def strip_dsym(self, platfiles):
         """ Remove .dSYM directories in the bundled application """
 
         #
         # should be completely removed when the "strip" option is specified.
         #
         if self.dry_run:
-            return
+            return platfiles
         for dirpath, dnames, fnames in os.walk(self.appdir):
             for nm in list(dnames):
                 if nm.endswith('.dSYM'):
                     print "removing debug info: %s/%s"%(dirpath, nm)
                     shutil.rmtree(os.path.join(dirpath, nm))
                     dnames.remove(nm)
+        return [file for file in platfiles if '.dSYM' not in file]
 
     def strip_files(self, files):
         unstripped = 0L