[Buildbot-commits] buildbot/buildbot/steps shell.py,1.5,1.6

Brian Warner warner at users.sourceforge.net
Wed Jul 4 05:09:43 UTC 2007


Update of /cvsroot/buildbot/buildbot/buildbot/steps
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31546/buildbot/steps

Modified Files:
	shell.py 
Log Message:
[project @ ShellCommand: allow workdir= to be a WithProperties. Closes #43.]

Original author: warner at lothar.com
Date: 2007-07-04 05:08:34+00:00

Index: shell.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/steps/shell.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- shell.py	18 Jun 2007 02:52:49 -0000	1.5
+++ shell.py	4 Jul 2007 05:09:41 -0000	1.6
@@ -170,6 +170,11 @@
                 command_argv.append(argv)
         return command_argv
 
+    def _interpolateWorkdir(self, workdir):
+        if isinstance(workdir, WithProperties):
+            return workdir.render(self.build)
+        return workdir
+
     def setupEnvironment(self, cmd):
         # merge in anything from Build.slaveEnvironment . Earlier steps
         # (perhaps ones which compile libraries or sub-projects that need to
@@ -213,6 +218,7 @@
         assert isinstance(command, (list, tuple, str))
         # create the actual RemoteShellCommand instance now
         kwargs = self.remote_kwargs
+        kwargs['workdir'] = self._interpolateWorkdir(kwargs['workdir'])
         kwargs['command'] = command
         kwargs['logfiles'] = self.logfiles
         cmd = RemoteShellCommand(**kwargs)





More information about the Commits mailing list