# HG changeset patch # User Bernhard Herzog # Date 1259668072 0 # Node ID 5f442b0cf3a49554440b1ecae5342854148b3aa5 # Parent 163f0d8b64ebe722d89891c49705ad3e6f21ddb9 New command line argument --stop-on-error for runtreepkg.py and corresponding parameter for PackagerGroup. If given, treepkg stops immediately when a build-attempt fails. diff -r 163f0d8b64eb -r 5f442b0cf3a4 bin/runtreepkg.py --- a/bin/runtreepkg.py Tue Dec 01 11:42:14 2009 +0000 +++ b/bin/runtreepkg.py Tue Dec 01 11:47:52 2009 +0000 @@ -41,6 +41,9 @@ help=("Check the packagers only once and exit afterwards." " Without this option, the tree packager will" " check periodically.")) + parser.add_option("--stop-on-error", action="store_true", + help=("Stop the tree packager when a packaging" + " attempt fails.")) parser.add_option("--revision", help=("SVN revision to update to before attempting" " to package.")) @@ -80,6 +83,7 @@ for opts in packager_opts], revision=options.revision, do_svn_update=not options.no_svn_update, + stop_on_error=options.stop_on_error, **treepkg_opts) if options.once: group.check_package_tracks() diff -r 163f0d8b64eb -r 5f442b0cf3a4 treepkg/packager.py --- a/treepkg/packager.py Tue Dec 01 11:42:14 2009 +0000 +++ b/treepkg/packager.py Tue Dec 01 11:47:52 2009 +0000 @@ -567,11 +567,13 @@ class PackagerGroup(object): def __init__(self, package_tracks, check_interval, revision=None, - instructions_file=None, do_svn_update=True): + instructions_file=None, do_svn_update=True, + stop_on_error=False): self.package_tracks = package_tracks self.check_interval = check_interval self.revision = revision self.do_svn_update = do_svn_update + self.stop_on_error = stop_on_error self.instructions_file = instructions_file self.instructions_file_removed = False self.sort_tracks() @@ -659,6 +661,8 @@ except: logging.exception("An error occurred while" " checking packager track %r", track.name) + if self.stop_on_error: + raise if repeat: logging.info("Built binaries needed by other tracks." " Starting over to ensure all dependencies"