# HG changeset patch # User Bernhard Herzog # Date 1232449595 0 # Node ID f4a636ed5d075208ca926ddd7f3d714baa1dd010 # Parent 351427b28b769231f03bd753f1f99613824b1ca5 Add execute command to treepkgbuilder diff -r 351427b28b76 -r f4a636ed5d07 bin/treepkgbuilder.py --- a/bin/treepkgbuilder.py Fri Jan 16 20:42:06 2009 +0000 +++ b/bin/treepkgbuilder.py Tue Jan 20 11:06:35 2009 +0000 @@ -1,5 +1,5 @@ #! /usr/bin/python2.4 -# Copyright (C) 2007, 2008 by Intevation GmbH +# Copyright (C) 2007, 2008, 2009 by Intevation GmbH # Authors: # Bernhard Herzog # @@ -157,6 +157,27 @@ logfile=self.opts.logfile) +class ExecuteCommand(Command): + + names = ("execute",) + + def create_parser(self): + parser = super(ExecuteCommand, self).create_parser() + parser.add_option("--logfile", help=("Log file.")) + parser.add_option("--bind-mount", action="append", + help=("Directories to bind-mount in the chroot" + " environment.")) + return parser + + def run(self): + if not self.rest: + print >>sys.stderr, "At least the script file must be specified" + sys.exit(1) + script = self.rest + self.get_builder().run_script(script, bindmounts=self.opts.bind_mount, + logfile=self.opts.logfile) + + class HelpCommand(Command): names = ("help", "--help", "-h")