From eabfcf5e872971848ec00d877d9afc78455e0efe Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 20 Sep 2008 08:02:45 +0000 Subject: 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 --- pym/_emerge/__init__.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'pym/_emerge/__init__.py') 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: -- cgit v1.2.3-1-g7c22