diff carton.py @ 38:99c610473c17

if develop fails, go with install
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 09 Apr 2012 13:44:16 -0700
parents 33e5d444ff30
children d9dcc5a1503b
line wrap: on
line diff
--- a/carton.py	Mon Apr 09 13:20:05 2012 -0700
+++ b/carton.py	Mon Apr 09 13:44:16 2012 -0700
@@ -5,7 +5,7 @@
 
 To package up all files in a virtualenvs source directory (e.g.)::
 
-  python path/to/carton.py myproject project/src/* 
+  python path/to/carton.py myproject project/src/*
 
 This will create a self-extracting file, `myproject.py`, that will unfold
 a virtualenv with the specified packages setup for development
@@ -137,7 +137,10 @@
             continue
         subdir = os.path.join(srcdir, i)
         if os.path.exists(os.path.join(srcdir, i, 'setup.py')):
-            call([python, 'setup.py', 'develop'], cwd=subdir)
+            try:
+                call([python, 'setup.py', 'develop'], cwd=subdir)
+            except:
+                call([python, 'setup.py', 'install'], cwd=subdir)
             # TODO: try `setup.py install` if develop fails for distutils packages
             setup_pys.add(i)