diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-10 00:37:54 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-10 00:37:54 -0700 |
commit | bf8bed7916ce3be898adc24c424705730ed06a02 (patch) | |
tree | 9374cd45fd33bf2e3ba13146b9547cdea963d958 | |
parent | 8e7a2082f726b64f3742266148b89e7cb4101ee4 (diff) | |
download | portage-bf8bed7916ce3be898adc24c424705730ed06a02.tar.gz portage-bf8bed7916ce3be898adc24c424705730ed06a02.tar.bz2 portage-bf8bed7916ce3be898adc24c424705730ed06a02.zip |
When executing the 'depend' phase inside aux_get(), use the
EbuildMetadataPhase class, so we can eliminate redundant code.
-rw-r--r-- | pym/portage/dbapi/porttree.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index b0cd5f49a..1db15da51 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -35,6 +35,8 @@ from portage import _encodings from portage import _unicode_decode from portage import _unicode_encode from portage import OrderedDict +from _emerge.EbuildMetadataPhase import EbuildMetadataPhase +from _emerge.TaskScheduler import TaskScheduler import os as _os import codecs @@ -524,8 +526,7 @@ class portdbapi(dbapi): if metadata is not None: return None - import _emerge - process = _emerge.EbuildMetadataPhase(cpv=cpv, ebuild_path=ebuild_path, + process = EbuildMetadataPhase(cpv=cpv, ebuild_path=ebuild_path, ebuild_mtime=emtime, metadata_callback=self._metadata_callback, portdb=self, repo_path=repo_path, settings=self.doebuild_settings) return process @@ -664,16 +665,24 @@ class portdbapi(dbapi): if eapi is not None and not portage.eapi_is_supported(eapi): mydata['EAPI'] = eapi + self._metadata_callback( + mycpv, myebuild, mylocation, mydata, emtime) else: - myret = doebuild(myebuild, "depend", - self.doebuild_settings["ROOT"], self.doebuild_settings, - dbkey=mydata, tree="porttree", mydbapi=self) - if myret != os.EX_OK: + sched = TaskScheduler() + proc = EbuildMetadataPhase(cpv=mycpv, ebuild_path=myebuild, + ebuild_mtime=emtime, + metadata_callback=self._metadata_callback, portdb=self, + repo_path=mylocation, scheduler=sched.sched_iface, + settings=self.doebuild_settings) + + sched.add(proc) + sched.run() + + if proc.returncode != os.EX_OK: self._broken_ebuilds.add(myebuild) raise KeyError(mycpv) - self._metadata_callback( - mycpv, myebuild, mylocation, mydata, emtime) + mydata.update(proc.metadata) if mydata.get("INHERITED", False): mydata["_eclasses_"] = self._repo_info[mylocation |