[arch-projects] [namcap 1/6] Don't assume local DB when looking up providers

Dan McGee dan at archlinux.org
Wed Jun 1 12:16:47 EDT 2011

Fixes the first warning in the following output. It is clearly invalid
due to the fact that I don't even have [testing] enabled on this

    $ ./namcap-devel -r shebangdepends pyalpm-0.4.2-1-i686.pkg.tar.xz
    pyalpm W: Dependency 'python3' on your system is a testing release
    pyalpm W: Dependency included and not needed ('pacman')

Signed-off-by: Dan McGee <dan at archlinux.org>
 Namcap/package.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Namcap/package.py b/Namcap/package.py
index dae6c44..245169c 100644
--- a/Namcap/package.py
+++ b/Namcap/package.py
@@ -240,13 +240,13 @@ def load_from_db(pkgname, dbname = None):
 	p = db.get_pkg(pkgname)
 	if p is None:
-		p = lookup_provider(pkgname)
+		p = lookup_provider(pkgname, db)
 	if p is not None:
 		p = load_from_alpm(p)
 	return p
-def lookup_provider(pkgname):
-	for pkg in pyalpm.get_localdb().pkgcache:
+def lookup_provider(pkgname, db):
+	for pkg in db.pkgcache:
 		if pkgname in pkg.provides:
 			return pkg

More information about the arch-projects mailing list