[Treepkg-commits] r116 - in trunk: bin treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jul 30 21:23:10 CEST 2008


Author: bh
Date: 2008-07-30 21:23:10 +0200 (Wed, 30 Jul 2008)
New Revision: 116

Modified:
   trunk/bin/runtreepkg.py
   trunk/treepkg/packager.py
Log:
When building a subset of tracks, make sure new packages are added to
pbuilder even if the tracks that depend on them are not being built.  To
achieve this, the information which tracks are to be built is now stored
as the do_build flag in the individual tracks and not by passing only a
subset of the tracks ot the PackagerGroup.  Otherwise the PackagerGroup
would not determine the dependencies correctly.


Modified: trunk/bin/runtreepkg.py
===================================================================
--- trunk/bin/runtreepkg.py	2008-07-30 19:00:31 UTC (rev 115)
+++ trunk/bin/runtreepkg.py	2008-07-30 19:23:10 UTC (rev 116)
@@ -49,15 +49,17 @@
     treepkg_opts, packager_opts = read_config(options.config_file)
 
     if args:
-        packager_opts = [opts for opts in packager_opts if opts["name"] in args]
-        # check whether we got all of the names in args:
-        for opts in packager_opts:
-            name = opts["name"]
-            if name in args:
-                args.remove(name)
-        for name in args:
-            print >>sys.stderr, "No package tracks found named %r" % name
+        selected_tracks = set(args)
+    else:
+        selected_tracks = set(opts["name"] for opts in packager_opts)
 
+    for opts in packager_opts:
+        name = opts["name"]
+        opts["do_build"] = name in selected_tracks
+        selected_tracks.discard(name)
+    for name in selected_tracks:
+        print >>sys.stderr, "No package track found named %r" % name
+
     if packager_opts:
         group = PackagerGroup([create_package_track(**opts)
                                for opts in packager_opts],

Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py	2008-07-30 19:00:31 UTC (rev 115)
+++ trunk/treepkg/packager.py	2008-07-30 19:23:10 UTC (rev 116)
@@ -306,7 +306,7 @@
     def __init__(self, name, base_dir, svn_url, root_cmd, pbuilderrc, deb_email,
                  deb_fullname, packager_class="treepkg.packager",
                  debrevision_prefix="treepkg", handle_dependencies=False,
-                 signing_key_id=""):
+                 signing_key_id="", do_build=True):
         self.name = name
         self.base_dir = base_dir
         self.svn_url = svn_url
@@ -316,6 +316,7 @@
         self.deb_fullname = deb_fullname
         self.debrevision_prefix = debrevision_prefix
         self.signing_key_id = signing_key_id
+        self.do_build = do_build
         self.handle_dependencies = handle_dependencies
         self.dependencies = None
         self.pkg_dir_template = "%(revision)d-%(increment)d"
@@ -442,6 +443,8 @@
         If do_svn_update is true -- the default -- update the working
         copy to the the revision specified with the revision parameter
         or if revision is None, the latest revision in the repository."""
+        if not self.do_build:
+            return None
         if do_svn_update:
             self.update_checkout(revision=revision)
         current_revision = self.last_changed_revision()



More information about the Treepkg-commits mailing list