Пример #1
0
 def write(self, commands, stream):
     p = uprint(stream)
     verbose = ' --verbose' if self.echo else ''
     jobs = ' --jobs %s' % self.jobs if self.jobs else ''
     p('#!%s --shebang --eta%s%s --' % (require_executable('parallel'), jobs, verbose))
     for i, subcommands in enumerate(commands):
         p(" && ".join(subcommands + [pbar(i+1, len(commands))]))
Пример #2
0
 def write(self, commands, stream):
     p = uprint(stream)
     prefix = '' if self.echo else '@'
     targets = ' '.join('d%s' % i for i in xrange(0, len(commands)))
     p('.PHONY: all %s' % targets)
     p('all: %s' % targets)
     p()
     for i, subcommands in enumerate(commands):
         p('d%s:' % i)
         for subcommand in subcommands:
             p('\t%s%s' % (prefix, self._escape(subcommand)))
         p('\t@%s' % pbar(i+1, len(commands)))
Пример #3
0
 def write(self, commands, stream):
     p = uprint(stream)
     p('#!%s' % require_executable('sh', ['bash', 'zsh', 'dash', 'sh']))
     p('set -eu')
     if self.echo:
         p('set -x')
     for i, subcommands in enumerate(commands):
         p("\n".join(subcommands))
         if self.echo:
             p('( set +x ; %s ) 2>/dev/null' % pbar(i+1, len(commands)))
         else:
             p(pbar(i+1, len(commands)))
         p()