From 7b537c443c83b7ad297d4a027d902d8459a75490 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 3 Oct 2011 03:02:10 -0700 Subject: repoman: account for GLEP 59 in RMD160 check --- bin/repoman | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/bin/repoman b/bin/repoman index 20f4b15b0..711fce98b 100755 --- a/bin/repoman +++ b/bin/repoman @@ -20,6 +20,7 @@ import signal import stat import sys import tempfile +import textwrap import time import platform @@ -547,24 +548,6 @@ if vcs_global_opts is None: vcs_global_opts = "" vcs_global_opts = vcs_global_opts.split() -if vcs == "cvs" and \ - "commit" == options.mode and \ - "RMD160" not in portage.checksum.hashorigin_map: - from portage.util import grablines - repo_lines = grablines("./CVS/Repository") - if repo_lines and \ - "gentoo-x86" == repo_lines[0].strip().split(os.path.sep)[0]: - msg = "Please install " \ - "pycrypto or enable python's ssl USE flag in order " \ - "to enable RMD160 hash support. See bug #198398 for " \ - "more information." - prefix = bad(" * ") - from textwrap import wrap - for line in wrap(msg, 70): - print(prefix + line) - sys.exit(1) - del repo_lines - if options.mode == 'commit' and not options.pretend and not vcs: logging.info("Not in a version controlled repository; enabling pretend mode.") options.pretend = True @@ -588,6 +571,7 @@ portdb = trees[root]['porttree'].dbapi # Constrain dependency resolution to the master(s) # that are specified in layout.conf. repodir = os.path.realpath(portdir_overlay) +repo_config = repoman_settings.repositories.get_repo_for_location(repodir) repo_info = portdb._repo_info[repodir] portdb.porttrees = list(repo_info.eclass_db.porttrees) portdir = portdb.porttrees[0] @@ -597,8 +581,24 @@ portdir = portdb.porttrees[0] # can be used to prevent merge conflicts like those that # thin-manifests is designed to prevent. sign_manifests = "sign" in repoman_settings.features and \ - repoman_settings.repositories.get_repo_for_location( - repodir).sign_manifest + repo_config.sign_manifest + +manifest_hashes = repo_config.manifest_hashes +if manifest_hashes is None: + manifest_hashes = portage.const.MANIFEST2_HASH_DEFAULTS + +if "commit" == options.mode and \ + repo_config.name == "gentoo" and \ + "RMD160" in manifest_hashes and \ + "RMD160" not in portage.checksum.hashorigin_map: + msg = "Please install " \ + "pycrypto or enable python's ssl USE flag in order " \ + "to enable RMD160 hash support. See bug #198398 for " \ + "more information." + prefix = bad(" * ") + for line in textwrap.wrap(msg, 70): + print(prefix + line) + sys.exit(1) # Generate an appropriate PORTDIR_OVERLAY value for passing into the # profile-specific config constructor calls. -- cgit v1.2.3-1-g7c22