Bug 865216 - Recognize exacutables on WINNT in is_executable. r=glandium
authorJacek Caban <jacek@codeweavers.com>
Thu, 25 Apr 2013 10:02:37 +0200
changeset 140793 c9f50b631b7da596aecec506bfc910f89db41b39
parent 140792 7a0df791c0f8d8ed0ca49bcd5d17a49a9f57ca65
child 140794 78bdcb813be1cffebeb33a4f87b6eb8073ec3a1e
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs865216
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 865216 - Recognize exacutables on WINNT in is_executable. r=glandium
python/mozbuild/mozpack/executables.py
--- a/python/mozbuild/mozpack/executables.py
+++ b/python/mozbuild/mozpack/executables.py
@@ -57,29 +57,29 @@ def get_type(path):
             return MACHO
         return UNKNOWN
 
 
 def is_executable(path):
     '''
     Return whether a given file path points to an executable or a library,
     where an executable or library is identified by:
-        - the file extension on OS/2
+        - the file extension on OS/2 and WINNT
         - the file signature on OS/X and ELF systems (GNU/Linux, Android, BSD,
           Solaris)
 
     As this function is intended for use to choose between the ExecutableFile
     and File classes in FileFinder, and choosing ExecutableFile only matters
-    on OS/2, OS/X and ELF systems, we don't bother detecting other kind of
-    executables.
+    on OS/2, OS/X, ELF and WINNT (in GCC build) systems, we don't bother
+    detecting other kind of executables.
     '''
     if not os.path.exists(path):
         return False
 
-    if substs['OS_ARCH'] == 'OS2':
+    if substs['OS_ARCH'] == 'OS2' or substs['OS_ARCH'] == 'WINNT':
         return path.lower().endswith((substs['DLL_SUFFIX'],
                                       substs['BIN_SUFFIX']))
 
     return get_type(path) != UNKNOWN
 
 
 def may_strip(path):
     '''