public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] repoman: support metadata/layout.conf restrict-allowed
@ 2019-08-06  3:40 Zac Medico
  0 siblings, 0 replies; only message in thread
From: Zac Medico @ 2019-08-06  3:40 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny, Zac Medico

Bug: https://bugs.gentoo.org/690786
Signed-off-by: Zac Medico <zmedico@gentoo.org>
---
 lib/portage/repository/config.py                      | 8 +++++++-
 repoman/lib/repoman/modules/scan/metadata/restrict.py | 6 +++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index 2b2b1e151..46bb6b65a 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -103,6 +103,7 @@ class RepoConfig(object):
 		'portage1_profiles_compat',
 		'priority',
 		'profile_formats',
+		'restrict_allowed',
 		'sign_commit',
 		'sign_manifest',
 		'strict_misc_digests',
@@ -339,7 +340,7 @@ class RepoConfig(object):
 			for value in ('allow-missing-manifest',
 				'cache-formats',
 				'create-manifest', 'disable-manifest', 'manifest-hashes',
-				'manifest-required-hashes', 'profile-formats',
+				'manifest-required-hashes', 'profile-formats', 'restrict-allowed',
 				'sign-commit', 'sign-manifest', 'thin-manifest', 'update-changelog'):
 				setattr(self, value.lower().replace("-", "_"), layout_data[value])
 
@@ -1142,6 +1143,11 @@ def parse_layout_conf(repo_location, repo_name=None):
 	data['eapis-banned'] = tuple(layout_data.get('eapis-banned', '').split())
 	data['eapis-deprecated'] = tuple(layout_data.get('eapis-deprecated', '').split())
 
+	restrict_allowed = layout_data.get('restrict-allowed')
+	if restrict_allowed is not None:
+		restrict_allowed = tuple(restrict_allowed.split())
+	data['restrict-allowed'] = restrict_allowed
+
 	data['sign-commit'] = layout_data.get('sign-commits', 'false').lower() \
 		== 'true'
 
diff --git a/repoman/lib/repoman/modules/scan/metadata/restrict.py b/repoman/lib/repoman/modules/scan/metadata/restrict.py
index 99784f231..f39128b24 100644
--- a/repoman/lib/repoman/modules/scan/metadata/restrict.py
+++ b/repoman/lib/repoman/modules/scan/metadata/restrict.py
@@ -18,6 +18,10 @@ class RestrictChecks(ScanBase):
 		'''
 		self.qatracker = kwargs.get('qatracker')
 		self.repo_settings = kwargs.get('repo_settings')
+		if self.repo_settings.repo_config.restrict_allowed is None:
+			self._restrict_allowed = self.repo_settings.qadata.valid_restrict
+		else:
+			self._restrict_allowed = self.repo_settings.repo_config.restrict_allowed
 
 	def check(self, **kwargs):
 		xpkg = kwargs.get('xpkg')
@@ -35,7 +39,7 @@ class RestrictChecks(ScanBase):
 
 		if myrestrict:
 			myrestrict = set(myrestrict)
-			mybadrestrict = myrestrict.difference(self.repo_settings.qadata.valid_restrict)
+			mybadrestrict = myrestrict.difference(self._restrict_allowed)
 
 			if mybadrestrict:
 				for mybad in mybadrestrict:
-- 
2.21.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-06  3:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-06  3:40 [gentoo-portage-dev] [PATCH] repoman: support metadata/layout.conf restrict-allowed Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox