Only escape the executable python string itself on the display line.
[scons.git] / SConstruct
index 4b386299a1ef0b495d6799b3c1788d343bdf84be..1c2cc47e42a08f09123d5393e61ca35f32e3b7d1 100644 (file)
@@ -6,10 +6,10 @@
 
 # When this gets changed, you must also change the copyright_years string
 # in QMTest/TestSCons.py so the test scripts look for the right string.
-copyright_years = '2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008'
+copyright_years = '2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010'
 
 # This gets inserted into the man pages to reflect the month of release.
-month_year = 'December 2008'
+month_year = 'January 2010'
 
 #
 # __COPYRIGHT__
@@ -48,6 +48,8 @@ project = 'scons'
 default_version = '1.2.0'
 copyright = "Copyright (c) %s The SCons Foundation" % copyright_years
 
+platform = distutils.util.get_platform()
+
 SConsignFile()
 
 #
@@ -55,15 +57,20 @@ SConsignFile()
 # is available on this system.
 #
 def whereis(file):
+    exts = ['']
+    if platform == "win32":
+        exts += ['.exe']
     for dir in string.split(os.environ['PATH'], os.pathsep):
         f = os.path.join(dir, file)
-        if os.path.isfile(f):
-            try:
-                st = os.stat(f)
-            except:
-                continue
-            if stat.S_IMODE(st[stat.ST_MODE]) & 0111:
-                return f
+        for ext in exts:
+            f_ext = f + ext
+            if os.path.isfile(f_ext):
+                try:
+                    st = os.stat(f_ext)
+                except:
+                    continue
+                if stat.S_IMODE(st[stat.ST_MODE]) & 0111:
+                    return f_ext
     return None
 
 #
@@ -76,8 +83,8 @@ dh_builddeb = whereis('dh_builddeb')
 fakeroot = whereis('fakeroot')
 gzip = whereis('gzip')
 rpmbuild = whereis('rpmbuild') or whereis('rpm')
-hg = whereis('hg')
-svn = whereis('svn')
+hg = os.path.exists('.hg') and whereis('hg')
+svn = os.path.exists('.svn') and whereis('svn')
 unzip = whereis('unzip')
 zip = whereis('zip')
 
@@ -163,8 +170,6 @@ if build_id is None:
 
 python_ver = sys.version[0:3]
 
-platform = distutils.util.get_platform()
-
 # Re-exporting LD_LIBRARY_PATH is necessary if the Python version was
 # built with the --enable-shared option.
 
@@ -716,7 +721,10 @@ for p in [ scons ]:
     platform_zip = os.path.join(build,
                                 'dist',
                                 "%s.%s.zip" % (pkg_version, platform))
-    win32_exe = os.path.join(build, 'dist', "%s.win32.exe" % pkg_version)
+    if platform == "win-amd64":
+        win32_exe = os.path.join(build, 'dist', "%s.win-amd64.exe" % pkg_version)
+    else:
+        win32_exe = os.path.join(build, 'dist', "%s.win32.exe" % pkg_version)
 
     #
     # Update the environment with the relevant information
@@ -836,7 +844,7 @@ for p in [ scons ]:
     AddPostAction(dist_distutils_targets, Chmod(dist_distutils_targets, 0644))
 
     if not gzip:
-        print "gzip not found; skipping .tar.gz package for %s." % pkg
+        print "gzip not found in %s; skipping .tar.gz package for %s." % (os.environ['PATH'], pkg)
     else:
 
         distutils_formats.append('gztar')