diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-07-17 15:21:04 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-07-17 15:21:04 -0700 |
commit | 9ea1eb84c6c2cd91e31196471ec8ad4339988611 (patch) | |
tree | 858c3bb43a799b2f7bcaf3d97966847d5a24a831 /pym/portage/dbapi | |
parent | 484d2df3fb2f65414746dbb85fa81d99f374648f (diff) | |
download | portage-9ea1eb84c6c2cd91e31196471ec8ad4339988611.tar.gz portage-9ea1eb84c6c2cd91e31196471ec8ad4339988611.tar.bz2 portage-9ea1eb84c6c2cd91e31196471ec8ad4339988611.zip |
Propagate EAPI for update_dbentry (bug #426476).
Diffstat (limited to 'pym/portage/dbapi')
-rw-r--r-- | pym/portage/dbapi/__init__.py | 7 | ||||
-rw-r--r-- | pym/portage/dbapi/bintree.py | 6 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 6 |
3 files changed, 14 insertions, 5 deletions
diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index ac8d31169..b999fb5df 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -275,17 +275,17 @@ class dbapi(object): maxval = len(cpv_all) aux_get = self.aux_get aux_update = self.aux_update - meta_keys = ["DEPEND", "RDEPEND", "PDEPEND", "PROVIDE", 'repository'] + meta_keys = ["DEPEND", "EAPI", "RDEPEND", "PDEPEND", "PROVIDE", 'repository'] repo_dict = None if isinstance(updates, dict): repo_dict = updates - from portage.update import update_dbentries if onUpdate: onUpdate(maxval, 0) if onProgress: onProgress(maxval, 0) for i, cpv in enumerate(cpv_all): metadata = dict(zip(meta_keys, aux_get(cpv, meta_keys))) + eapi = metadata.pop('EAPI') repo = metadata.pop('repository') if repo_dict is None: updates_list = updates @@ -301,7 +301,8 @@ class dbapi(object): if not updates_list: continue - metadata_updates = update_dbentries(updates_list, metadata) + metadata_updates = \ + portage.update_dbentries(updates_list, metadata, eapi=eapi) if metadata_updates: aux_update(cpv, metadata_updates) if onUpdate: diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index 1048cc108..e3de50f08 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -377,6 +377,10 @@ class binarytree(object): if not origmatches: return moves for mycpv in origmatches: + try: + mycpv = self.dbapi._pkg_str(mycpv, None) + except (KeyError, InvalidData): + continue mycpv_cp = portage.cpv_getkey(mycpv) if mycpv_cp != origcp: # Ignore PROVIDE virtual match. @@ -404,7 +408,7 @@ class binarytree(object): moves += 1 mytbz2 = portage.xpak.tbz2(tbz2path) mydata = mytbz2.get_data() - updated_items = update_dbentries([mylist], mydata) + updated_items = update_dbentries([mylist], mydata, eapi=mycpv.eapi) mydata.update(updated_items) mydata[b'PF'] = \ _unicode_encode(mynewpkg + "\n", diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index dddc094d2..264790a03 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -321,6 +321,10 @@ class vardbapi(dbapi): if not origmatches: return moves for mycpv in origmatches: + try: + mycpv = self._pkg_str(mycpv, None) + except (KeyError, InvalidData): + continue mycpv_cp = cpv_getkey(mycpv) if mycpv_cp != origcp: # Ignore PROVIDE virtual match. @@ -358,7 +362,7 @@ class vardbapi(dbapi): del e write_atomic(os.path.join(newpath, "PF"), new_pf+"\n") write_atomic(os.path.join(newpath, "CATEGORY"), mynewcat+"\n") - fixdbentries([mylist], newpath) + fixdbentries([mylist], newpath, eapi=mycpv.eapi) return moves def cp_list(self, mycp, use_cache=1): |