import stat
import sys
import tempfile
+import textwrap
import time
import platform
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
# 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]
# 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.