comparison master.cfg @ 62:7f3b5857f569

EnvShellCommand: fix construction of command for ShellCommand parent class
author John W. Eaton <jwe@octave.org>
date Sat, 23 Mar 2024 00:16:26 -0400
parents 10c1848313c6
children f4ff3fa0e556
comparison
equal deleted inserted replaced
61:10c1848313c6 62:7f3b5857f569
267 ## from a file in ShellCommand steps. We use this instead of 267 ## from a file in ShellCommand steps. We use this instead of
268 ## ShellCommand in all rules for the Octave buildbot. 268 ## ShellCommand in all rules for the Octave buildbot.
269 269
270 class EnvShellCommand (ShellCommand): 270 class EnvShellCommand (ShellCommand):
271 def __init__ (self, command = '', **kwargs): 271 def __init__ (self, command = '', **kwargs):
272 kwargs['command'] = [ 272 shell_cmd = 'if [ -f "$HOME/buildbot-worker-env" ]; then source "$HOME/buildbot-worker-env"; else echo "$HOME/buildbot-worker-env not found"; fi; '
273 'bash', '-c', 'if [ -f "$HOME/buildbot-worker-env" ]; then source "$HOME/buildbot-worker-env"; else echo "$HOME/buildbot-worker-env not found"; fi; %s' % command 273 if isinstance (command, list):
274 ] 274 shell_cmd += ' '.join (command)
275 else:
276 shell_cmd += command
277 kwargs['command'] = ['bash', '-c', shell_cmd]
275 ShellCommand.__init__ (self, **kwargs) 278 ShellCommand.__init__ (self, **kwargs)
276 279
277 ## Steps we may use in more than one build factory. 280 ## Steps we may use in more than one build factory.
278 281
279 def build_cmd_list (cmd, nice = 0, opts = []): 282 def build_cmd_list (cmd, nice = 0, opts = []):