[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.49-113-g2c98b1d

Andreas Beckmann anbe at debian.org
Sun Mar 3 09:14:06 UTC 2013


The following commit has been merged in the piatti branch:
commit 5823156549e4337d258f8e2db9f9ca3cafd8c215
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sat Mar 2 13:42:48 2013 +0100

    p-m: use DistroConfig
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/debian/changelog b/debian/changelog
index 6441ff6..59828cc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -32,6 +32,7 @@ piuparts (0.50) UNRELEASED; urgency=low
     - Optimize reserve() and skip unavailable candidates.
   * piuparts-master.py:
     - Sort packages to be tested by importance, i.e. descending waiting_count.
+    - Use distros.conf to compute URLs.
   * piuparts-slave.py:
     - Tarball recreation can be disabled by setting max-tgz-age to 0.
     - Relax package existence checks to allow distupgrading to backports.
diff --git a/piuparts-master.py b/piuparts-master.py
index adfb417..0ca0e08 100644
--- a/piuparts-master.py
+++ b/piuparts-master.py
@@ -36,6 +36,7 @@ from piupartslib.packagesdb import LogfileExists
 
 
 CONFIG_FILE = "/etc/piuparts/piuparts.conf"
+DISTRO_CONFIG_FILE = "/etc/piuparts/distros.conf"
 
 
 def setup_logging(log_level, log_file_name):
@@ -152,18 +153,21 @@ class Master(Protocol):
     def _load_package_database(self, section):
         config = Config(section=section, defaults_section="global")
         config.read(CONFIG_FILE)
+        distro_config = piupartslib.conf.DistroConfig(DISTRO_CONFIG_FILE, config["mirror"])
         db = piupartslib.packagesdb.PackagesDB(prefix=section)
         if self._recycle_mode and self._section == section:
             db.enable_recycling()
         self._package_databases[section] = db
-        packages_url = config.get_packages_url()
+        packages_url = distro_config.get_packages_url(
+                config.get_distro(), config.get_area(), config.get_arch())
         logging.info("Fetching %s" % packages_url)
         packages_file = piupartslib.open_packages_url(packages_url)
         db.read_packages_file(packages_file)
         packages_file.close()
         if config.get_distro() != config.get_final_distro():
             # take version numbers (or None) from final distro
-            packages_url = config.get_packages_url(distro=config.get_final_distro())
+            packages_url = distro_config.get_packages_url(
+                    config.get_final_distro(), config.get_area(), config.get_arch())
             logging.info("Fetching %s" % packages_url)
             packages_file = piupartslib.open_packages_url(packages_url)
             db2 = piupartslib.packagesdb.PackagesFile(packages_file)

-- 
piuparts git repository



More information about the Piuparts-commits mailing list