[Piuparts-commits] [SCM] piuparts git repository branch, bikeshed, updated. 0.52-19-g9617a30

Andreas Beckmann anbe at debian.org
Tue May 28 12:53:23 UTC 2013


The following commit has been merged in the bikeshed branch:
commit cdfa0843c2d80ecf6f374419e1d4365efc1d8baa
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun May 26 15:23:56 2013 +0200

    lib/conf: resolve candidates to multiple URLs
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/debian/changelog b/debian/changelog
index 340417c..af6b0ac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ piuparts (0.53) UNRELEASED; urgency=low
       distro.
     - Define wheezy-proposed and squeeze-proposed.
   * piupartslib/conf.py:
+    - Add get_{packages,sources}_urls() that resolve "candidates".
   * piupartslib/packagesdb.py:
     - Add load_packages_urls() methods.
   * piuparts-{master-backend,slave,report}.py:
diff --git a/piupartslib/conf.py b/piupartslib/conf.py
index f4ef75a..fcb79a2 100644
--- a/piupartslib/conf.py
+++ b/piupartslib/conf.py
@@ -121,6 +121,7 @@ class DistroConfig(UserDict.UserDict):
                 "components": None,
                 "target-release": None,
                 "depends": None,
+                "candidates": None,
             }
         cp = ConfigParser.SafeConfigParser()
         cp.read(filename)
@@ -151,23 +152,28 @@ class DistroConfig(UserDict.UserDict):
             distro = self._expand_depends(distro)[0]
         return self.get(distro, "distribution") or distro
 
-    def get_packages_url(self, distro, area, arch):
+    def get_candidates(self, distro):
+        return (self.get(distro, "candidates") or "").split() or [distro]
+
+    def _get_packages_url(self, distro, area, arch):
         return "%s/dists/%s/%s/binary-%s/Packages.bz2" % (
                 self.get_mirror(distro),
                 self.get_distribution(distro),
                 area, arch)
 
     def get_packages_urls(self, distro, area, arch):
-        return [self.get_packages_url(distro, area, arch)]
+        return [self._get_packages_url(d, area, arch)
+                for d in self.get_candidates(distro)]
 
-    def get_sources_url(self, distro, area):
+    def _get_sources_url(self, distro, area):
         return "%s/dists/%s/%s/source/Sources.bz2" % (
                 self.get_mirror(distro),
                 self.get_distribution(distro),
                 area)
 
     def get_sources_urls(self, distro, area):
-        return [self.get_sources_url(distro, area)]
+        return [self._get_sources_url(d, area)
+                for d in self.get_candidates(distro)]
 
     def get_target_flags(self, distro):
         tr = self.get(distro, "target-release")

-- 
piuparts git repository



More information about the Piuparts-commits mailing list