From 50bea0375496f919fc40c586e8308b19f814ba66 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 15 Sep 2012 09:53:42 -0700 Subject: [PATCH] egencache: skip auxdb write if not metadata-trans --- bin/egencache | 4 +++- pym/_emerge/EbuildMetadataPhase.py | 9 ++++++--- pym/_emerge/MetadataRegen.py | 6 ++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bin/egencache b/bin/egencache index 003567452..ec62a8c08 100755 --- a/bin/egencache +++ b/bin/egencache @@ -212,9 +212,11 @@ class GenCache(object): else: self._cp_set = None self._cp_missing = set() + write_auxdb = "metadata-transfer" in portdb.settings.features self._regen = MetadataRegen(portdb, cp_iter=cp_iter, consumer=self._metadata_callback, - max_jobs=max_jobs, max_load=max_load) + max_jobs=max_jobs, max_load=max_load, + write_auxdb=write_auxdb) self.returncode = os.EX_OK conf = portdb.repositories.get_repo_for_location(tree) self._trg_caches = tuple(conf.iter_pregenerated_caches( diff --git a/pym/_emerge/EbuildMetadataPhase.py b/pym/_emerge/EbuildMetadataPhase.py index 669b4ae2e..1ffa1bb23 100644 --- a/pym/_emerge/EbuildMetadataPhase.py +++ b/pym/_emerge/EbuildMetadataPhase.py @@ -25,7 +25,7 @@ class EbuildMetadataPhase(SubProcess): """ __slots__ = ("cpv", "eapi_supported", "ebuild_hash", "fd_pipes", - "metadata", "portdb", "repo_path", "settings") + \ + "metadata", "portdb", "repo_path", "settings", "write_auxdb") + \ ("_eapi", "_eapi_lineno", "_raw_metadata",) _file_names = ("ebuild",) @@ -180,8 +180,11 @@ class EbuildMetadataPhase(SubProcess): metadata["_eclasses_"] = {} metadata.pop("INHERITED", None) - self.portdb._write_cache(self.cpv, - self.repo_path, metadata, self.ebuild_hash) + # If called by egencache, this cache write is + # undesirable when metadata-transfer is disabled. + if self.write_auxdb is not False: + self.portdb._write_cache(self.cpv, + self.repo_path, metadata, self.ebuild_hash) else: metadata = {"EAPI": metadata["EAPI"]} self.metadata = metadata diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py index e82015fd1..234298f7e 100644 --- a/pym/_emerge/MetadataRegen.py +++ b/pym/_emerge/MetadataRegen.py @@ -10,9 +10,10 @@ from _emerge.PollScheduler import PollScheduler class MetadataRegen(PollScheduler): def __init__(self, portdb, cp_iter=None, consumer=None, - max_jobs=None, max_load=None): + max_jobs=None, max_load=None, write_auxdb=True): PollScheduler.__init__(self, main=True) self._portdb = portdb + self._write_auxdb = write_auxdb self._global_cleanse = False if cp_iter is None: cp_iter = self._iter_every_cp() @@ -84,7 +85,8 @@ class MetadataRegen(PollScheduler): yield EbuildMetadataPhase(cpv=cpv, ebuild_hash=ebuild_hash, portdb=portdb, repo_path=repo_path, - settings=portdb.doebuild_settings) + settings=portdb.doebuild_settings, + write_auxdb=self._write_auxdb) def _keep_scheduling(self): return self._remaining_tasks and not self._terminated_tasks -- 2.26.2