changeset 19:c6e459be8534

fix install script
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 29 Feb 2012 16:15:31 -0800
parents 76c939271534
children 1eb5e82605a5
files INSTALL.py
diffstat 1 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/INSTALL.py	Wed Feb 29 16:05:08 2012 -0800
+++ b/INSTALL.py	Wed Feb 29 16:15:31 2012 -0800
@@ -43,11 +43,24 @@
     # clone the repository
     call(['hg', 'clone', REPO], cwd=src)
 
-"""
-XXX unfinished
+    # find the virtualenv python
+    python = None
+    for path in (('bin', 'python'), ('Scripts', 'python.exe')):
+        _python = os.path.join(DEST, *path)
+        if os.path.exists(_python)
+            python = _python
+            break
+    else:
+        raise Exception("Python binary not found in %s" % DEST)
 
-hg clone ${REPO}
-cd FileServer
-python setup.py develop
-"""
+    # find the clone
+    filename = REPO.rstrip('/')
+    filename = REPO.split('/')[-1]
+    clone = os.path.join(src, filename)
+    assert os.path.exists(clone), "Clone directory not found in %s" % src
 
+    # ensure setup.py exists
+    assert os.path.exists(os.path.join(clone, 'setup.py')), 'setup.py not found in %s' % clone
+
+    # install the package in develop mode
+    call([python 'setup.py', 'develop'], cwd=clone)