diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-10-03 22:42:22 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-10-03 22:42:22 -0700 |
commit | 12cf3eb1397dc2b33b087f6e37878d94a15a6b9f (patch) | |
tree | d6a7302e1ef8418447f3f902adeda9d58f21f7d0 | |
parent | b33ab8168a18391cc8ebe3d0b8bbcdc53a1a1c3d (diff) | |
download | portage-12cf3eb1397dc2b33b087f6e37878d94a15a6b9f.tar.gz portage-12cf3eb1397dc2b33b087f6e37878d94a15a6b9f.tar.bz2 portage-12cf3eb1397dc2b33b087f6e37878d94a15a6b9f.zip |
repoman: bail out if unsupported manifest-hashes
-rwxr-xr-x | bin/repoman | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/repoman b/bin/repoman index 711fce98b..7943f54ef 100755 --- a/bin/repoman +++ b/bin/repoman @@ -587,6 +587,31 @@ manifest_hashes = repo_config.manifest_hashes if manifest_hashes is None: manifest_hashes = portage.const.MANIFEST2_HASH_DEFAULTS +if options.mode in ("commit", "fix", "manifest"): + if portage.const.MANIFEST2_REQUIRED_HASH not in manifest_hashes: + msg = ("The 'manifest-hashes' setting in the '%s' repository's " + "metadata/layout.conf does not contain the '%s' hash which " + "is required by this portage version. You will have to " + "upgrade portage if you want to generate valid manifests for " + "this repository.") % \ + (repo_config.name, portage.const.MANIFEST2_REQUIRED_HASH) + for line in textwrap.wrap(msg, 70): + logging.error(line) + sys.exit(1) + + unsupported_hashes = manifest_hashes.difference( + portage.const.MANIFEST2_HASH_FUNCTIONS) + if unsupported_hashes: + msg = ("The 'manifest-hashes' setting in the '%s' repository's " + "metadata/layout.conf contains one or more hash types '%s' " + "which are not supported by this portage version. You will " + "have to upgrade portage if you want to generate valid " + "manifests for this repository.") % \ + (repo_config.name, " ".join(sorted(unsupported_hashes))) + for line in textwrap.wrap(msg, 70): + logging.error(line) + sys.exit(1) + if "commit" == options.mode and \ repo_config.name == "gentoo" and \ "RMD160" in manifest_hashes and \ |