changeset 77:7493ba72cce7

* use absolute paths for finding (works in unix bash)
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 11 Jan 2011 15:39:26 -0800
parents 6a79522282c3
children aa99dc11f707
files autobot/process/factory.py autobot/projects/autobot/__init__.py
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/autobot/process/factory.py	Tue Jan 11 15:23:36 2011 -0800
+++ b/autobot/process/factory.py	Tue Jan 11 15:39:26 2011 -0800
@@ -12,14 +12,14 @@
   """
   returns a command to echo the found file cross-platform
   """
-  args = ['[ -e "%s" ]; then echo "%s"' % (arg, arg) for arg in args]
+  args = ['[ -e "%s" ]; then echo "${PWD}/%s"' % (arg, arg) for arg in args]
   command = 'if %s; else false; fi' % '; elif '.join(args)
   return ['bash', '-c', command]
 
 
 class VirtualenvFactory(BuildFactory):
   """
-  create a virtualenv
+  create a virtualenv and install some python packages in it
   """
 
   def __init__(self, name='env', hg_sources=(), git_sources=()):
@@ -42,15 +42,11 @@
                              command=find('Scripts', 'bin'),
                              workdir=WithProperties('%(virtualenv)s')))
     self.findScript('python')
-#    self.addStep(SetProperty(property='python',
-#                             workdir=WithProperties('%(virtualenv)s/%(scripts)s'),
-#                             command=find('python', 'python.exe')))
 
     # add a source directory
     self.addStep(ShellCommand(command=['mkdir', '-p', 'src'],
                               workdir=WithProperties('%(virtualenv)s')))
 
-
     # clone hg repositories
     for hg_source in hg_sources:
       self.addStep(ShellCommand(command=['hg', 'clone', hg_source],
@@ -70,7 +66,7 @@
     """
     self.addStep(SetProperty(property=script,
                              command=find(script, script + '.exe'),
-                             workdir=WithProperties('%(virtualenv)s/%(scripts)s')))
+                             workdir=WithProperties('%(scripts)s')))
 
 
 
--- a/autobot/projects/autobot/__init__.py	Tue Jan 11 15:23:36 2011 -0800
+++ b/autobot/projects/autobot/__init__.py	Tue Jan 11 15:39:26 2011 -0800
@@ -12,5 +12,9 @@
     PythonSourceFactory.__init__(self, name='autobot',
                                  hg_sources=['http://k0s.org/mozilla/hg/autobot'])
 
-    # run the tests
-    
+    # find the template
+    self.findScript('create-autobot')
+
+    # make sure the template actually does something
+    self.addStep(ShellCommand([WithProperties('%(create-autobot)s'),
+                               '--list-factories'])