[Piuparts-commits] [piuparts] 01/03: lib/db: load_alternate_versions_from_packages_urls(): new method

Holger Levsen holger at moszumanska.debian.org
Tue Jan 21 14:28:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit 3d286f910b8318f551730d33a97a3815dbc5b69b
Author: Andreas Beckmann <anbe at debian.org>
Date:   Tue Jan 21 13:00:47 2014 +0100

    lib/db: load_alternate_versions_from_packages_urls(): new method
    
    to replace the Version of all packages loaded from an older distro
    with the current version (or "None") in the final distro
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 piupartslib/packagesdb.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 59c56f6..d3b7084 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -361,6 +361,16 @@ class PackagesDB:
         self._packages_files.append(pf)
         self._packages = None
 
+    def load_alternate_versions_from_packages_urls(self, urls):
+        # take version numbers (or None) from alternate URLs
+        pf2 = PackagesFile()
+        pf2.load_packages_urls(urls)
+        for package in self.get_all_packages():
+            if package["Package"] in pf2:
+                package["Version"] = pf2[package["Package"]]["Version"]
+            else:
+                package["Version"] = "None"
+
     def get_urls(self):
         urls = []
         for pf in self._packages_files:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list