[Numpy-svn] r4139 - in branches/numpy.scons: . numpy/distutils/command

numpy-svn@scip... numpy-svn@scip...
Wed Sep 26 02:44:51 CDT 2007


Author: cdavid
Date: 2007-09-26 02:44:39 -0500 (Wed, 26 Sep 2007)
New Revision: 4139

Modified:
   branches/numpy.scons/
   branches/numpy.scons/numpy/distutils/command/scons.py
Log:
Protect path when passing them from distutils to scons


Property changes on: branches/numpy.scons
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2007-09-25 23:59:52.404999971 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

   + timestamp: 2007-09-26 16:34:29.266999960 +0900
committer: David Cournapeau <david@ar.media.kyoto-u.ac.jp>
properties: 
	branch-nick: numpy.scons

Name: bzr:revision-id:v3-trunk0
   - 3737 david@david-laptop-20070920080908-n8pj8vmszdir3zoa
3738 david@david-laptop-20070920081509-58kkojgmml3t7jxs
3739 david@david-laptop-20070920081910-phlk1ujthksgpm0z
3740 david@david-laptop-20070920082641-bdhrt6eafeoli50i
3741 david@ar.media.kyoto-u.ac.jp-20070920130730-satdeppbh1k0bq2p
3743 david@ar.media.kyoto-u.ac.jp-20070921073742-vpv8pwv0j8fbd93m
3744 david@david-laptop-20070922101656-61kfi2faucemr2rl
3745 david@david-laptop-20070922113708-ror18thshang1cpu
3747 david@david-laptop-20070922140534-n9xsl096tjrzmct1
3749 david@david-laptop-20070922154007-usit009fr6vp377j
3750 david@david-laptop-20070923070011-leu2ozc2fy1q5cht
3751 david@david-laptop-20070924015925-dhsiao40jp7zsfp9
3752 david@ar.media.kyoto-u.ac.jp-20070924070657-nbw23j0ayan30cli
3753 david@ar.media.kyoto-u.ac.jp-20070924082918-i1lc1zikywi8czj4
3754 david@ar.media.kyoto-u.ac.jp-20070924083008-c0edtt8zs31yeh1q
3755 david@ar.media.kyoto-u.ac.jp-20070924112351-pnnho638cohz6lj1
3756 david@david-laptop-20070924153247-yftud00bynilxv69
3757 david@david-laptop-20070924163545-pish34x9fq2h66aj
3758 david@david-laptop-20070924164633-iiyygcaw81ji3n34
3759 david@david-laptop-20070924170201-y14v2yzikdpvamfp
3760 david@david-laptop-20070924171208-5bmitorzf49d1aa2
3761 david@david-laptop-20070925014444-ns9v90gotnxt39mq
3769 david@david-laptop-20070925145952-4osi81tvch7v6luj

   + 3737 david@david-laptop-20070920080908-n8pj8vmszdir3zoa
3738 david@david-laptop-20070920081509-58kkojgmml3t7jxs
3739 david@david-laptop-20070920081910-phlk1ujthksgpm0z
3740 david@david-laptop-20070920082641-bdhrt6eafeoli50i
3741 david@ar.media.kyoto-u.ac.jp-20070920130730-satdeppbh1k0bq2p
3743 david@ar.media.kyoto-u.ac.jp-20070921073742-vpv8pwv0j8fbd93m
3744 david@david-laptop-20070922101656-61kfi2faucemr2rl
3745 david@david-laptop-20070922113708-ror18thshang1cpu
3747 david@david-laptop-20070922140534-n9xsl096tjrzmct1
3749 david@david-laptop-20070922154007-usit009fr6vp377j
3750 david@david-laptop-20070923070011-leu2ozc2fy1q5cht
3751 david@david-laptop-20070924015925-dhsiao40jp7zsfp9
3752 david@ar.media.kyoto-u.ac.jp-20070924070657-nbw23j0ayan30cli
3753 david@ar.media.kyoto-u.ac.jp-20070924082918-i1lc1zikywi8czj4
3754 david@ar.media.kyoto-u.ac.jp-20070924083008-c0edtt8zs31yeh1q
3755 david@ar.media.kyoto-u.ac.jp-20070924112351-pnnho638cohz6lj1
3756 david@david-laptop-20070924153247-yftud00bynilxv69
3757 david@david-laptop-20070924163545-pish34x9fq2h66aj
3758 david@david-laptop-20070924164633-iiyygcaw81ji3n34
3759 david@david-laptop-20070924170201-y14v2yzikdpvamfp
3760 david@david-laptop-20070924171208-5bmitorzf49d1aa2
3761 david@david-laptop-20070925014444-ns9v90gotnxt39mq
3769 david@david-laptop-20070925145952-4osi81tvch7v6luj
3773 david@ar.media.kyoto-u.ac.jp-20070926073429-2kdc6yf1o210aer0


Modified: branches/numpy.scons/numpy/distutils/command/scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/scons.py	2007-09-25 16:35:42 UTC (rev 4138)
+++ branches/numpy.scons/numpy/distutils/command/scons.py	2007-09-26 07:44:39 UTC (rev 4139)
@@ -68,6 +68,11 @@
         raise DistutilsSetupError("Could not find compiler executable info for scons")
     return fullpath
 
+def protect_path(path):
+    """Convert path (given as a string) to something the shell will have no
+    problem to understand (space, etc... problems)."""
+    # XXX: to this correctly, this is totally bogus for now.
+    return '"' + path + '"'
 class scons(old_build_ext):
     description = "Scons builder"
     #user_options = []
@@ -127,15 +132,15 @@
         # XXX: does this work everywhere in all situations ? This assumes
         # scons.py is executable.
         scons_exec = get_python_exec_invoc()
-        scons_exec += ' "' + pjoin(get_scons_local_path(), 'scons.py') + '"'
+        scons_exec += protect_path(pjoin(get_scons_local_path(), 'scons.py'))
         for i in self.scons_scripts:
             cmd = scons_exec + " -f " + i + ' -I. '
             cmd += ' src_dir="%s" ' % pdirname(i)
-            cmd += ' distutils_libdir="%s" ' % pjoin(self.build_lib, pdirname(i))
+            cmd += ' distutils_libdir="%s" ' % protect_path(pjoin(self.build_lib, pdirname(i)))
             cmd += ' cc_opt=%s ' % dist2sconscc(self.compiler)
-            cmd += ' cc_opt_path="%s" ' % get_tool_path(self.compiler)
+            cmd += ' cc_opt_path="%s" ' % protect_path(get_tool_path(self.compiler))
             print cmd
             st = os.system(cmd)
             if st:
                 print "status is %d" % st
-                raise DistutilsExecError("Error while executing scons (see above)")
+                raise DistutilsExecError("Error while executing scons command %s (see above)" % cmd)



More information about the Numpy-svn mailing list