[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.51
Andreas Beckmann
anbe at debian.org
Wed May 15 10:09:49 UTC 2013
The following commit has been merged in the master branch:
commit 92351eb93cddea6839999fa86b2c2fdcc6891e03
Author: Andreas Beckmann <anbe at debian.org>
Date: Mon Apr 8 11:01:04 2013 +0200
lib/db: get_package(): add flag resolve_virtual
Return the first provider of a virtual package if no real package with that
name exists. Disabled by default.
Signed-off-by: Andreas Beckmann <anbe at debian.org>
diff --git a/debian/changelog b/debian/changelog
index 5478121..45c6c04 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ piuparts (0.51) UNRELEASED; urgency=low
* piupartslib/conf.py:
- Raise MissingSection if the requested section is not in piuparts.conf.
* piupartslib/packagesdb.py:
+ - get_package(): Add flag resolve_virtual, disabled by default.
* Rename piuparts-master.py to piuparts-master-backend.py
* piuparts-master: New.
- Wrapper shell script to simplify calling the master from the slave.
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index afa5e6c..6eb49ef 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -396,11 +396,7 @@ class PackagesDB:
more = more[1:]
if dep not in deps:
deps.append(dep)
- dep_pkg = self.get_package(dep, recurse=True)
- if dep_pkg is None:
- providers = self.get_providers(dep)
- if providers:
- dep_pkg = self.get_package(providers[0], recurse=True)
+ dep_pkg = self.get_package(dep, recurse=True, resolve_virtual=True)
if dep_pkg is not None:
more += dep_pkg.dependencies()
return deps
@@ -414,11 +410,7 @@ class PackagesDB:
more = more[1:]
if dep not in deps:
deps.append(dep)
- dep_pkg = self.get_package(dep, recurse=True)
- if dep_pkg is None:
- providers = self.get_providers(dep)
- if providers:
- dep_pkg = self.get_package(providers[0], recurse=True)
+ dep_pkg = self.get_package(dep, recurse=True, resolve_virtual=True)
if dep_pkg is not None and package_name in self._get_recursive_dependencies(dep_pkg):
circular.append(dep)
more += dep_pkg.dependencies()
@@ -599,13 +591,17 @@ class PackagesDB:
self._find_all_packages()
return name in self._packages
- def get_package(self, name, recurse=False):
+ def get_package(self, name, recurse=False, resolve_virtual=False):
if name in self._packages:
return self._packages[name]
elif recurse:
for db in self._dependency_databases:
if db.has_package(name):
return db.get_package(name)
+ elif resolve_virtual:
+ providers = self.get_providers(name, recurse=recurse)
+ if providers:
+ return self.get_package(providers[0], recurse=recurse, resolve_virtual=False)
return None
def get_providers(self, name, recurse=True):
--
piuparts git repository
More information about the Piuparts-commits
mailing list