diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-09-20 08:02:45 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-09-20 08:02:45 +0000 |
commit | eabfcf5e872971848ec00d877d9afc78455e0efe (patch) | |
tree | 31177f8456238da4db28c6507d81011ceb28dba1 /pym/_emerge/__init__.py | |
parent | 0df2d2b63bdbf81a3519acc84999bc62a0a9549b (diff) | |
download | portage-eabfcf5e872971848ec00d877d9afc78455e0efe.tar.gz portage-eabfcf5e872971848ec00d877d9afc78455e0efe.tar.bz2 portage-eabfcf5e872971848ec00d877d9afc78455e0efe.zip |
Implement SRC_URI arrows for EAPI 2. The portdbapi.getfetchlist() method
is now deprecated and there is a new getFetchMap() method that returns
a dict which maps each file name to a set of alternative URIs. The
portage.fetch() function uses introspection to detect when such a dict
is passed in and handles it appropriately, while maintaining backward
compatibility if a list of uris is passed in.
svn path=/main/trunk/; revision=11522
Diffstat (limited to 'pym/_emerge/__init__.py')
-rw-r--r-- | pym/_emerge/__init__.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 5c5aaa731..6cfe7eb66 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -431,7 +431,7 @@ class search(object): pass self.portdb = fake_portdb for attrib in ("aux_get", "cp_all", - "xmatch", "findname", "getfetchlist"): + "xmatch", "findname", "getFetchMap"): setattr(fake_portdb, attrib, getattr(self, "_"+attrib)) self._dbs = [] @@ -478,14 +478,14 @@ class search(object): return value return None - def _getfetchlist(self, *args, **kwargs): + def _getFetchMap(self, *args, **kwargs): for db in self._dbs: - func = getattr(db, "getfetchlist", None) + func = getattr(db, "getFetchMap", None) if func: value = func(*args, **kwargs) if value: return value - return [], [] + return {} def _visible(self, db, cpv, metadata): installed = db is self.vartree.dbapi @@ -684,8 +684,7 @@ class search(object): from portage import manifest mf = manifest.Manifest( pkgdir, self.settings["DISTDIR"]) - fetchlist = self.portdb.getfetchlist(mycpv, - mysettings=self.settings, all=True)[1] + fetchlist = self.portdb.getFetchMap(mycpv) try: mysum[0] = mf.getDistfilesSize(fetchlist) except KeyError, e: |