[Piuparts-commits] [piuparts] 03/12: lib/db: Package: set test_versions to the version in the final distro
Holger Levsen
holger at layer-acht.org
Wed Oct 11 14:58:44 UTC 2017
This is an automated email from the git hooks/post-receive script.
holger pushed a commit to branch develop
in repository piuparts.
commit 3a2187cdb65fae64beea9d00d4dfe934fff6bc95
Author: Andreas Beckmann <anbe at debian.org>
Date: Wed Oct 4 04:18:58 2017 +0200
lib/db: Package: set test_versions to the version in the final distro
Signed-off-by: Andreas Beckmann <anbe at debian.org>
Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
debian/changelog | 1 +
piupartslib/packagesdb.py | 11 ++++++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 8f5585e..ce2e7d3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ piuparts (0.83) UNRELEASED; urgency=medium
* piupartslib/packagesdb.py:
- Add new package data accessors name(), version(), test_versions().
- Use test_versions() in all places referring to a piuparts test.
+ - Set test_versions while loading versions from the final target distro.
-- Holger Levsen <holger at debian.org> Sat, 07 Oct 2017 17:42:12 +0200
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 140d345..b011193 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -75,9 +75,14 @@ class Package(UserDict.UserDict):
def version(self):
return self["Version"]
+ def set_test_versions(self, tv):
+ self["TestVersions"] = tv
+
def test_versions(self):
"""ToDo: for distupgrade tests test_versions() should return a list
of versions in all distros in the upgrade path"""
+ if "TestVersions" in self:
+ return self["TestVersions"]
return self.version()
def _parse_dependencies(self, header_name):
@@ -390,10 +395,10 @@ class PackagesDB:
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"]
+ if package.name() in pf2:
+ package.set_test_versions(pf2[package.name()].version())
else:
- package["Version"] = "None"
+ package.set_test_versions("None")
def get_urls(self):
urls = []
--
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