Mercurial > treepkg
diff bin/treepkgbuilder.py @ 210:63f73bb9c459
Add build command to bin/treepkgbuilder.py
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Fri, 14 Nov 2008 19:41:21 +0000 |
parents | 6624e731e218 |
children | 98c5aab790bb |
line wrap: on
line diff
--- a/bin/treepkgbuilder.py Fri Nov 14 19:41:03 2008 +0000 +++ b/bin/treepkgbuilder.py Fri Nov 14 19:41:21 2008 +0000 @@ -128,6 +128,26 @@ self.get_builder().login() +class BuildCommand(Command): + + names = ("build",) + + def create_parser(self): + parser = super(BuildCommand, self).create_parser() + parser.add_option("--logfile", help=("The file for the build log.")) + parser.add_option("--binary-dir", + help=("Directory for the binary packages.")) + return parser + + def run(self): + if len(self.rest) != 1: + print >>sys.stderr, "Exactly one .dsc file must be specified" + sys.exit(1) + dsc_file = self.rest[0] + self.get_builder().build(dsc_file, binary_dir=self.opts.binary_dir, + logfile=self.opts.logfile) + + class HelpCommand(Command): names = ("help", "--help", "-h")