Commits

Anonymous committed eba20fe

* No longer require a 'version.plist' inside the python framework
* Remove .dSYM directories when the --strip option is specified.

Comments (0)

Files changed (2)

 
 Features:
 
+- When the '--strip' option is specified we now also remove '.dSYM' 
+  directories from the bundle.
+
+- Remove dependency on a 'version.plist' file in the python framework
+
 - A new recipe for `PyQt`_ 4.x. This recipe was donated by Kevin Walzer.
 
 - A new recipe for `virtualenv`_, this allows you to use py2app from 

py2app/build_app.py

                     mm.mm.run_file(fmwk)
                 platfiles = mm.run()
                 if self.strip:
+                    self.strip_dsym()
                     self.strip_files(platfiles)
             self.app_files.append(dst)
 
                     copy_file(pth, os.path.join(target_dir, fname))
 
 
+    def strip_dsym(self):
+        """ Remove .dSYM directories in the bundled application """
+
+        #
+        # .dSYM directories are contain detached debugging information and
+        # should be completely removed when the "strip" option is specified.
+        #
+        if self.dry_run:
+            return
+        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)
 
     def strip_files(self, files):
         unstripped = 0L
         fmwkfiles = [
             os.path.basename(info['name']),
             'Resources/Info.plist',
-            'Resources/version.plist',
             'include/%s/pyconfig.h'%(pydir,),
             'lib/%s/config/Makefile'%(pydir,)
         ]