schmir / bbfreeze

UNMAINTAINED
http://pypi.python.org/pypi/bbfreeze/
92 stars 22 forks source link

exe.manifest #2

Closed LawrenceK closed 14 years ago

LawrenceK commented 14 years ago

A recent upgrade to something (setuptools or distutils) means that setup.py is also creating a .exe.manifest with the script .exe file that bdist_bbfreeze then attempts to compile. The file is an xml file.

The following patch amends bdist_bbfreeze to only attempt compile of scripts ending in .py or .pyw.

--- bdist_bbfreeze.py.1 2009-12-18 10:17:12.339250000 +0000
+++ bdist_bbfreeze.py   2010-01-03 11:47:55.584832600 +0000
@@ -87,11 +87,13 @@
         # freeze each of the scripts
         for args in get_script_args(dist, wininst=wininst):
             name = args[0]
-            if name.endswith('.exe'):
-                # skip .exes
-                continue
-            log.info('bbfreezing %s', os.path.join(self.script_dir, name))
-            f.addScript(os.path.join(self.script_dir, name),
-                        gui_only=name.endswith('.pyw'))
+            # only compile python scripts
+            # somewhere we have aquired a .exe.manifest
+            fullname = os.path.join(self.script_dir, name)
+            if os.path.splitext(name)[1] in ['.py', '.pyw']:
+                log.info('bbfreezing %s', fullname)
+                f.addScript(fullname, gui_only=name.endswith('.pyw'))
+            else:
+                log.info('bbfreezing skipping %s', fullname)
         # starts the freezing process
         f()
schmir commented 14 years ago

I've fixed this in d3d2bbe. thanks.