aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2015-03-21 13:20:02 -0700
committerBrian Dolbec <dolsen@gentoo.org>2015-04-03 17:47:00 -0700
commit5207ede9ea7ce8d3fb659eab56c0dd58bdc72dbc (patch)
treec8fff111b4f3e63f0733b3eaa69bf631e7d1f2c4
parentportage/package/ebuild/digestcheck: Initial Manifest signature verification a... (diff)
downloadportage-5207ede9ea7ce8d3fb659eab56c0dd58bdc72dbc.tar.gz
portage-5207ede9ea7ce8d3fb659eab56c0dd58bdc72dbc.tar.bz2
portage-5207ede9ea7ce8d3fb659eab56c0dd58bdc72dbc.zip
portage/package/ebuild/digestcheck.py: Add a digestcheck cache
Emerge was calling digestcheck in 2 places for the same package in the same emerge run. This caches the first time and returns True if found in the cache.
-rw-r--r--pym/portage/package/ebuild/digestcheck.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pym/portage/package/ebuild/digestcheck.py b/pym/portage/package/ebuild/digestcheck.py
index 641de9a62..c97211929 100644
--- a/pym/portage/package/ebuild/digestcheck.py
+++ b/pym/portage/package/ebuild/digestcheck.py
@@ -13,6 +13,8 @@ from portage.localization import _
from portage.output import EOutput
from portage.util import writemsg
+_digestcheck_cache = set()
+
def digestcheck(myfiles, mysettings, strict=False, justmanifest=None, mf=None):
"""
Verifies checksums. Assumes all files have been downloaded.
@@ -29,7 +31,11 @@ def digestcheck(myfiles, mysettings, strict=False, justmanifest=None, mf=None):
if mysettings.get("EBUILD_SKIP_MANIFEST") == "1":
return 1
+
pkgdir = mysettings["O"]
+ if pkgdir in _digestcheck_cache:
+ return 1
+
hash_filter = _hash_filter(mysettings.get("PORTAGE_CHECKSUM_FILTER", ""))
if hash_filter.transparent:
hash_filter = None
@@ -95,6 +101,7 @@ def digestcheck(myfiles, mysettings, strict=False, justmanifest=None, mf=None):
if mf.thin or mf.allow_missing:
# In this case we ignore any missing digests that
# would otherwise be detected below.
+ _digestcheck_cache.add(pkgdir)
return 1
# Make sure that all of the ebuilds are actually listed in the Manifest.
for f in os.listdir(pkgdir):
@@ -166,4 +173,5 @@ def digestcheck(myfiles, mysettings, strict=False, justmanifest=None, mf=None):
os.path.join(filesdir, f), noiselevel=-1)
if strict:
return 0
+ _digestcheck_cache.add(pkgdir)
return 1