changeset 49:5e14fe86bc52

fix some things
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 10 Jan 2011 12:17:57 -0800
parents 0e014622ac1e
children a39959f8c0a5
files autobot/process/factory.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/autobot/process/factory.py	Mon Jan 10 11:53:09 2011 -0800
+++ b/autobot/process/factory.py	Mon Jan 10 12:17:57 2011 -0800
@@ -12,7 +12,9 @@
   """
   returns a command to echo the found file
   """
-  return ' || '.join(['ls -d %s 2> /dev/null' % arg for arg in args])
+  args = ['[ -e "%s" ]; then echo "%s"' % (arg, arg) for arg in args]
+  command = 'if %s; else false; fi' % '; elif '.join(args)
+  return ['bash', '-c', command]
 
 class VirtualenvFactory(BuildFactory):
   """
@@ -27,7 +29,7 @@
     BuildFactory.__init__(self)
 
     self.addStep(CreateVirtualenv(name))
-    self.addStep(ShellCommand(command=['mkdir', 'src'],
+    self.addStep(ShellCommand(command=['mkdir', '-p', 'src'],
                               workdir=name))
     # TODO: set properities:
     # - virtualenv location