summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/MetadataRegen.py
diff options
context:
space:
mode:
authorBrian Harring <ferringb@chromium.org>2011-10-13 23:27:22 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-14 16:50:20 -0700
commit2ed1cb53cc4158af08c22d466b15b9a9a7767212 (patch)
tree9c2f87cfccd2f304baaece4b88db48a1f35db847 /pym/_emerge/MetadataRegen.py
parent90012f94f00ec2cf6b355bd9c30215b83c2b5b7f (diff)
downloadportage-2ed1cb53cc4158af08c22d466b15b9a9a7767212.tar.gz
portage-2ed1cb53cc4158af08c22d466b15b9a9a7767212.tar.bz2
portage-2ed1cb53cc4158af08c22d466b15b9a9a7767212.zip
cache: rewrite to support arbitrary validation method
Specifically, the cache can use any portage supported checksum method, or use the standard mtime approach. In addition, support controlling whether or not paths are stored, and generally try to restore some of the centralization/encapsulation that was in place originally. (cherry picked from commit bc1aed614fb588f0ade5bcb5d1265a8db0f8d247) Change-Id: Ic38057e7dbb15063c64a93c99e66e113a7d4c70e
Diffstat (limited to 'pym/_emerge/MetadataRegen.py')
-rw-r--r--pym/_emerge/MetadataRegen.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pym/_emerge/MetadataRegen.py b/pym/_emerge/MetadataRegen.py
index 810317533..b3380562b 100644
--- a/pym/_emerge/MetadataRegen.py
+++ b/pym/_emerge/MetadataRegen.py
@@ -3,6 +3,7 @@
import portage
from portage import os
+from portage.eclass_cache import hashed_path
from _emerge.EbuildMetadataPhase import EbuildMetadataPhase
from _emerge.PollScheduler import PollScheduler
@@ -68,16 +69,15 @@ class MetadataRegen(PollScheduler):
ebuild_path, repo_path = portdb.findname2(cpv)
if ebuild_path is None:
raise AssertionError("ebuild not found for '%s'" % cpv)
- metadata, st, emtime = portdb._pull_valid_cache(
+ metadata, ebuild_hash = portdb._pull_valid_cache(
cpv, ebuild_path, repo_path)
if metadata is not None:
if consumer is not None:
- consumer(cpv, ebuild_path,
- repo_path, metadata)
+ consumer(cpv, repo_path, metadata, ebuild_hash)
continue
- yield EbuildMetadataPhase(cpv=cpv, ebuild_path=ebuild_path,
- ebuild_mtime=emtime,
+ yield EbuildMetadataPhase(cpv=cpv,
+ ebuild_hash=ebuild_hash,
metadata_callback=portdb._metadata_callback,
portdb=portdb, repo_path=repo_path,
settings=portdb.doebuild_settings)
@@ -176,9 +176,9 @@ class MetadataRegen(PollScheduler):
# On failure, still notify the consumer (in this case the metadata
# argument is None).
self._consumer(metadata_process.cpv,
- metadata_process.ebuild_path,
metadata_process.repo_path,
- metadata_process.metadata)
+ metadata_process.metadata,
+ metadata_process.ebuild_hash)
self._schedule()