Changeset 252

Show
Ignore:
Timestamp:
Mon Feb 6 12:59:30 2006
Author:
giovannibajo
Message:

Make sure UPX is at least 1.92 to support --strip-loadconf

Files:

Legend:

Unmodified
Added
Removed
Modified
  • trunk/Build.py

    r251 r252  
    48 48     if iswin and is24:  
    49 49         # Binaries built with Visual Studio 7.1 require --strip-loadconf  
    50           # or they won't compress.  
      50         # or they won't compress. Configure.py makes sure that UPX is new  
      51         # enough to support --strip-loadconf.  
    51 52         f = "--strip-loadconf " + f  
    52 53     f = "--best " + f  
  • trunk/Configure.py

    r246 r252  
    21 21 HOME = os.path.dirname(sys.argv[0])  
    22 22 iswin = sys.platform[:3] == 'win'  
      23 is24 = hasattr(sys, "version_info") and sys.version_info[:2] >= (2,4)  
    23 24 cygwin = sys.platform == 'cygwin'  
    24 25 configfile = os.path.join(HOME, 'config.dat')  
     
    193 194 hasUPX = 0  
    194 195 try:  
    195       if iswin:  
    196           os.system('upx -V >upx.txt')  
    197           txt = open('upx.txt','r').read()  
    198           os.remove('upx.txt')  
    199           if txt[:3] == 'upx':  
    200               hasUPX = 1  
      196     vers = os.popen("upx -V").readlines()  
      197     if not vers:  
      198         hasUPX = 0  
    201 199     else:  
    202           rc = os.system('upx -V >/dev/null')  
    203           hasUPX = ( rc == 0 )  
    204       print 'I: ...UPX %s' % (('unavailable','available')[hasUPX])  
      200         v = string.split(vers[0])[1]  
      201         hasUPX = tuple(map(int, string.split(v, ".")))  
      202         if iswin and is24 and hasUPX < (1,92):  
      203             print 'E: UPX is too old! Python 2.4 under Windows requires UPX 1.92+'  
      204             hasUPX = 0  
      205     print 'I: ...UPX %s' % (('unavailable','available')[hasUPX != 0])  
    205 206 except Exception, e:  
    206 207     print 'I: ...exception result in testing for UPX'