changeset 307:5f442b0cf3a4

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.
author Bernhard Herzog <bh@intevation.de>
date Tue, 01 Dec 2009 11:47:52 +0000
parents 163f0d8b64eb
children 61d1daac23d4
files bin/runtreepkg.py treepkg/packager.py
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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()
--- 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"
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)