[Checkins] SVN: zc.buildout/branches/help-api/dev.py Allow to bootstrap using the development version.

Godefroid Chapelle gotcha at bubblenet.be
Sun Mar 29 17:25:32 EDT 2009


Log message for revision 98542:
  Allow to bootstrap using the development version.
  
  Signed-off-by: Georgy Berdyshev - ?\208?\147?\208?\181?\208?\190?\209?\128?\208?\179?\208?\184?\208?\185 ?\208?\145?\208?\181?\209?\128?\208?\180?\209?\139?\209?\136?\208?\181?\208?\178 <codingmaster at gmail.com>

Changed:
  U   zc.buildout/branches/help-api/dev.py

-=-
Modified: zc.buildout/branches/help-api/dev.py
===================================================================
--- zc.buildout/branches/help-api/dev.py	2009-03-29 21:25:25 UTC (rev 98541)
+++ zc.buildout/branches/help-api/dev.py	2009-03-29 21:25:31 UTC (rev 98542)
@@ -21,6 +21,11 @@
 
 import os, sys, urllib2
 
+is_jython = sys.platform.startswith('java')
+
+if is_jython:
+    import subprocess
+
 for d in 'eggs', 'develop-eggs', 'bin':
     if not os.path.exists(d):
         os.mkdir(d)
@@ -35,10 +40,16 @@
 
     import pkg_resources
 
-os.spawnle(os.P_WAIT, sys.executable, sys.executable, 'setup.py',
-           '-q', 'develop', '-m', '-x', '-d', 'develop-eggs',
-           {'PYTHONPATH': os.path.dirname(pkg_resources.__file__)},
-           )
+if is_jython:
+    subprocess.Popen([sys.executable] + ['setup.py', '-q', 'develop', '-m', '-x',
+                        '-d', 'develop-eggs'], 
+                        env = {'PYTHONPATH': os.path.dirname(pkg_resources.__file__)}).wait()
+else:
+    os.spawnle(os.P_WAIT, sys.executable, sys.executable, 'setup.py',
+               '-q', 'develop', '-m', '-x', '-d', 'develop-eggs',
+               {'PYTHONPATH': os.path.dirname(pkg_resources.__file__)},
+               )
+
 pkg_resources.working_set.add_entry('src')
 
 import zc.buildout.easy_install
@@ -46,4 +57,10 @@
     ['zc.buildout'], pkg_resources.working_set , sys.executable, 'bin')
 
 bin_buildout = os.path.join('bin', 'buildout')
-sys.exit(os.spawnl(os.P_WAIT, bin_buildout, bin_buildout))
+
+if is_jython:
+    # Jython needs the script to be called twice via sys.executable
+    assert subprocess.Popen([sys.executable] + [bin_buildout]).wait() == 0
+    sys.exit(subprocess.Popen([sys.executable] + [bin_buildout]).wait())
+else:
+    sys.exit(os.spawnl(os.P_WAIT, bin_buildout, bin_buildout))



More information about the Checkins mailing list