From 43fff141bc6d8db63b6ec6d21b085f09a7c0d12e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 14 Nov 2012 09:16:10 -0800 Subject: [PATCH] Pass settings to _pkg_str constructor. Forgotten in commit 0b4e6c27e87e57fac09fa28d3ed1320cb6a83ad9. --- pym/_emerge/FakeVartree.py | 2 +- pym/portage/dbapi/__init__.py | 7 +++++-- pym/portage/emaint/modules/move/move.py | 8 ++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pym/_emerge/FakeVartree.py b/pym/_emerge/FakeVartree.py index 9babb4c7b..17c95ac0c 100644 --- a/pym/_emerge/FakeVartree.py +++ b/pym/_emerge/FakeVartree.py @@ -290,7 +290,7 @@ def perform_global_updates(mycpv, mydb, myupdates): aux_keys = Package._dep_keys + mydb._pkg_str_aux_keys aux_dict = dict(zip(aux_keys, mydb.aux_get(mycpv, aux_keys))) try: - pkg = _pkg_str(mycpv, metadata=aux_dict) + pkg = _pkg_str(mycpv, metadata=aux_dict, settings=mydb.settings) except InvalidData: return aux_dict = dict((k, aux_dict[k]) for k in Package._dep_keys) diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index c6bdbc77a..49b72937d 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -301,9 +301,12 @@ class dbapi(object): if onProgress: onProgress(maxval, 0) for i, cpv in enumerate(cpv_all): - metadata = dict(zip(meta_keys, aux_get(cpv, meta_keys))) try: - pkg = _pkg_str(cpv, metadata=metadata) + metadata = dict(zip(meta_keys, aux_get(cpv, meta_keys))) + except KeyError: + continue + try: + pkg = _pkg_str(cpv, metadata=metadata, settings=self.settings) except InvalidData: continue metadata = dict((k, metadata[k]) for k in update_keys) diff --git a/pym/portage/emaint/modules/move/move.py b/pym/portage/emaint/modules/move/move.py index 607fbc42b..ef674d47a 100644 --- a/pym/portage/emaint/modules/move/move.py +++ b/pym/portage/emaint/modules/move/move.py @@ -51,6 +51,7 @@ class MoveHandler(object): match = self._tree.dbapi.match aux_get = self._tree.dbapi.aux_get pkg_str = self._tree.dbapi._pkg_str + settings = self._tree.dbapi.settings if onProgress: onProgress(0, 0) for repo, updates in allupdates.items(): @@ -97,9 +98,12 @@ class MoveHandler(object): if onProgress: onProgress(maxval, 0) for i, cpv in enumerate(cpv_all): - metadata = dict(zip(meta_keys, aux_get(cpv, meta_keys))) try: - pkg = _pkg_str(cpv, metadata=metadata) + metadata = dict(zip(meta_keys, aux_get(cpv, meta_keys))) + except KeyError: + continue + try: + pkg = _pkg_str(cpv, metadata=metadata, settings=settings) except InvalidData: continue metadata = dict((k, metadata[k]) for k in self._update_keys) -- 2.26.2