metadata/layout.conf: "sign-manifests = false"
authorZac Medico <zmedico@gentoo.org>
Tue, 13 Sep 2011 05:48:36 +0000 (22:48 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 13 Sep 2011 05:48:36 +0000 (22:48 -0700)
This allows repos to disable manifest signatures, which is useful if
they want to prevent merge conflicts like those that thin-manifests is
designed to prevent.

bin/repoman
pym/portage/repository/config.py

index 38b3273286b86407965b2d9b564af4e53786d289..e0cdf6ed44f974398f8a306bf074834a82987ab2 100755 (executable)
@@ -592,11 +592,13 @@ repo_info = portdb._repo_info[portdir_overlay]
 portdb.porttrees = list(repo_info.eclass_db.porttrees)
 portdir = portdb.porttrees[0]
 
-# Thin manifests imply reliance on the VCS for file integrity,
-# which implies that manifest signatures are not needed.
-sign_manifests = "sign" in repoman_settings.features and not \
+# In order to disable manifest signatures, repos may set
+# "sign-manifests = false" in metadata/layout.conf. This
+# 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(
-       portdir_overlay).thin_manifest
+       portdir_overlay).sign_manifest
 
 # Generate an appropriate PORTDIR_OVERLAY value for passing into the
 # profile-specific config constructor calls.
index 17839d7b8f98e89450c55be83f50e1988867a668..5cfe82f4ac35f8bf1543c271c91852df6908ae3d 100644 (file)
@@ -42,7 +42,7 @@ class RepoConfig(object):
        """Stores config of one repository"""
 
        __slots__ = ['aliases', 'eclass_overrides', 'eclass_locations', 'location', 'user_location', 'masters', 'main_repo',
-               'missing_repo_name', 'name', 'priority', 'sync', 'format', 'thin_manifest']
+               'missing_repo_name', 'name', 'priority', 'sync', 'format', 'sign_manifest', 'thin_manifest']
 
        def __init__(self, name, repo_opts):
                """Build a RepoConfig with options in repo_opts
@@ -111,6 +111,7 @@ class RepoConfig(object):
                        missing = False
                self.name = name
                self.missing_repo_name = missing
+               self.sign_manifest = True
                self.thin_manifest = False
 
        def load_manifest(self, *args, **kwds):
@@ -331,6 +332,9 @@ class RepoConfigLoader(object):
                                        aliases.extend(repo.aliases)
                                repo.aliases = tuple(sorted(set(aliases)))
 
+                       if layout_data.get('sign-manifests', '').lower() == 'false':
+                               repo.sign_manifest = False
+
                        if layout_data.get('thin-manifests', '').lower() == 'true':
                                repo.thin_manifest = True