public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/arches/
@ 2016-01-10  3:26 Brian Dolbec
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Dolbec @ 2016-01-10  3:26 UTC (permalink / raw
  To: gentoo-commits

commit:     0d13a8f7aab7206aae4a5e13dbe99ddaee8e69ba
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  3 19:11:22 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Jan 10 03:23:49 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0d13a8f7

repoman: Create a new ArchChecks class plugin

 pym/repoman/modules/scan/arches/__init__.py | 23 +++++++++++
 pym/repoman/modules/scan/arches/arches.py   | 64 +++++++++++++++++++++++++++++
 pym/repoman/scanner.py                      | 47 +--------------------
 3 files changed, 89 insertions(+), 45 deletions(-)

diff --git a/pym/repoman/modules/scan/arches/__init__.py b/pym/repoman/modules/scan/arches/__init__.py
new file mode 100644
index 0000000..b570dac
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/__init__.py
@@ -0,0 +1,23 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Arches plug-in module for repoman.
+Performs archs checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'arches',
+	'description': doc,
+	'provides':{
+		'archs-module': {
+			'name': "arches",
+			'class': "ArchChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_desc': {
+			},
+		},
+	}
+}
+

diff --git a/pym/repoman/modules/scan/arches/arches.py b/pym/repoman/modules/scan/arches/arches.py
new file mode 100644
index 0000000..2c32028
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/arches.py
@@ -0,0 +1,64 @@
+# -*- coding:utf-8 -*-
+
+
+class ArchChecks(object):
+
+	def __init__(self, **kwargs):
+		self.options = kwargs.get('options')
+		self.repo_settings = kwargs.get('repo_settings')
+		self.profiles = kwargs.get('profiles')
+
+	def check(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		if self.options.ignore_arches:
+			arches = [[
+				self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
+				self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
+		else:
+			arches = set()
+			for keyword in ebuild.keywords:
+				if keyword[0] == "-":
+					continue
+				elif keyword[0] == "~":
+					arch = keyword[1:]
+					if arch == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (
+									expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, arch, (arch, keyword)))
+				else:
+					# For ebuilds with stable keywords, check if the
+					# dependencies are satisfiable for unstable
+					# configurations, since use.stable.mask is not
+					# applied for unstable configurations (see bug
+					# 563546).
+					if keyword == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (expanded_arch,)))
+							arches.add(
+								(keyword, expanded_arch,
+									(expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, keyword, (keyword,)))
+						arches.add((keyword, keyword,
+							(keyword, "~" + keyword)))
+			if not arches:
+				# Use an empty profile for checking dependencies of
+				# packages that have empty KEYWORDS.
+				arches.add(('**', '**', ('**',)))
+		return {'continue': False, 'arches': arches}
+
+	@property
+	def runInPkgs(self):
+		return (False, [])
+
+	@property
+	def runInEbuilds(self):
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 83193fd..7b07a95 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -301,6 +301,7 @@ class Scanner(object):
 				('eapi', 'EAPIChecks'), ('ebuild_metadata', 'EbuildMetadata'),
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
+				('arches', 'ArchChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -351,50 +352,6 @@ class Scanner(object):
 				self.liveeclasscheck.check(
 					dynamic_data['pkg'], xpkg, dynamic_data['ebuild'], y_ebuild, dynamic_data['ebuild'].keywords, self.repo_metadata['pmaskdict'])
 
-			if self.options.ignore_arches:
-				arches = [[
-					self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
-					self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
-			else:
-				arches = set()
-				for keyword in dynamic_data['ebuild'].keywords:
-					if keyword[0] == "-":
-						continue
-					elif keyword[0] == "~":
-						arch = keyword[1:]
-						if arch == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (
-										expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, arch, (arch, keyword)))
-					else:
-						# For ebuilds with stable keywords, check if the
-						# dependencies are satisfiable for unstable
-						# configurations, since use.stable.mask is not
-						# applied for unstable configurations (see bug
-						# 563546).
-						if keyword == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (expanded_arch,)))
-								arches.add(
-									(keyword, expanded_arch,
-										(expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, keyword, (keyword,)))
-							arches.add((keyword, keyword,
-								(keyword, "~" + keyword)))
-				if not arches:
-					# Use an empty profile for checking dependencies of
-					# packages that have empty KEYWORDS.
-					arches.add(('**', '**', ('**',)))
-
 			unknown_pkgs = set()
 			baddepsyntax = False
 			badlicsyntax = False
@@ -551,7 +508,7 @@ class Scanner(object):
 				continue
 
 			relevant_profiles = []
-			for keyword, arch, groups in arches:
+			for keyword, arch, groups in dynamic_data['arches']:
 				if arch not in self.profiles:
 					# A missing profile will create an error further down
 					# during the KEYWORDS verification.


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/arches/
@ 2016-01-11  6:31 Brian Dolbec
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Dolbec @ 2016-01-11  6:31 UTC (permalink / raw
  To: gentoo-commits

commit:     022b27e63d10987a51ea9fb198099025111b2fb6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  3 19:11:22 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Jan 10 22:59:33 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=022b27e6

repoman: Create a new ArchChecks class plugin

 pym/repoman/modules/scan/arches/__init__.py | 23 +++++++++++
 pym/repoman/modules/scan/arches/arches.py   | 64 +++++++++++++++++++++++++++++
 pym/repoman/scanner.py                      | 47 +--------------------
 3 files changed, 89 insertions(+), 45 deletions(-)

diff --git a/pym/repoman/modules/scan/arches/__init__.py b/pym/repoman/modules/scan/arches/__init__.py
new file mode 100644
index 0000000..b570dac
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/__init__.py
@@ -0,0 +1,23 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Arches plug-in module for repoman.
+Performs archs checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'arches',
+	'description': doc,
+	'provides':{
+		'archs-module': {
+			'name': "arches",
+			'class': "ArchChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_desc': {
+			},
+		},
+	}
+}
+

diff --git a/pym/repoman/modules/scan/arches/arches.py b/pym/repoman/modules/scan/arches/arches.py
new file mode 100644
index 0000000..2c32028
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/arches.py
@@ -0,0 +1,64 @@
+# -*- coding:utf-8 -*-
+
+
+class ArchChecks(object):
+
+	def __init__(self, **kwargs):
+		self.options = kwargs.get('options')
+		self.repo_settings = kwargs.get('repo_settings')
+		self.profiles = kwargs.get('profiles')
+
+	def check(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		if self.options.ignore_arches:
+			arches = [[
+				self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
+				self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
+		else:
+			arches = set()
+			for keyword in ebuild.keywords:
+				if keyword[0] == "-":
+					continue
+				elif keyword[0] == "~":
+					arch = keyword[1:]
+					if arch == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (
+									expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, arch, (arch, keyword)))
+				else:
+					# For ebuilds with stable keywords, check if the
+					# dependencies are satisfiable for unstable
+					# configurations, since use.stable.mask is not
+					# applied for unstable configurations (see bug
+					# 563546).
+					if keyword == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (expanded_arch,)))
+							arches.add(
+								(keyword, expanded_arch,
+									(expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, keyword, (keyword,)))
+						arches.add((keyword, keyword,
+							(keyword, "~" + keyword)))
+			if not arches:
+				# Use an empty profile for checking dependencies of
+				# packages that have empty KEYWORDS.
+				arches.add(('**', '**', ('**',)))
+		return {'continue': False, 'arches': arches}
+
+	@property
+	def runInPkgs(self):
+		return (False, [])
+
+	@property
+	def runInEbuilds(self):
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 83193fd..7b07a95 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -301,6 +301,7 @@ class Scanner(object):
 				('eapi', 'EAPIChecks'), ('ebuild_metadata', 'EbuildMetadata'),
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
+				('arches', 'ArchChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -351,50 +352,6 @@ class Scanner(object):
 				self.liveeclasscheck.check(
 					dynamic_data['pkg'], xpkg, dynamic_data['ebuild'], y_ebuild, dynamic_data['ebuild'].keywords, self.repo_metadata['pmaskdict'])
 
-			if self.options.ignore_arches:
-				arches = [[
-					self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
-					self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
-			else:
-				arches = set()
-				for keyword in dynamic_data['ebuild'].keywords:
-					if keyword[0] == "-":
-						continue
-					elif keyword[0] == "~":
-						arch = keyword[1:]
-						if arch == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (
-										expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, arch, (arch, keyword)))
-					else:
-						# For ebuilds with stable keywords, check if the
-						# dependencies are satisfiable for unstable
-						# configurations, since use.stable.mask is not
-						# applied for unstable configurations (see bug
-						# 563546).
-						if keyword == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (expanded_arch,)))
-								arches.add(
-									(keyword, expanded_arch,
-										(expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, keyword, (keyword,)))
-							arches.add((keyword, keyword,
-								(keyword, "~" + keyword)))
-				if not arches:
-					# Use an empty profile for checking dependencies of
-					# packages that have empty KEYWORDS.
-					arches.add(('**', '**', ('**',)))
-
 			unknown_pkgs = set()
 			baddepsyntax = False
 			badlicsyntax = False
@@ -551,7 +508,7 @@ class Scanner(object):
 				continue
 
 			relevant_profiles = []
-			for keyword, arch, groups in arches:
+			for keyword, arch, groups in dynamic_data['arches']:
 				if arch not in self.profiles:
 					# A missing profile will create an error further down
 					# during the KEYWORDS verification.


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/arches/
@ 2016-01-11  8:01 Brian Dolbec
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Dolbec @ 2016-01-11  8:01 UTC (permalink / raw
  To: gentoo-commits

commit:     216c8b1b2132e6c2dc4b911256ad51724858d1c6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  3 19:11:22 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jan 11 08:00:16 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=216c8b1b

repoman: Create a new ArchChecks class plugin

 pym/repoman/modules/scan/arches/__init__.py | 23 +++++++++++
 pym/repoman/modules/scan/arches/arches.py   | 64 +++++++++++++++++++++++++++++
 pym/repoman/scanner.py                      | 47 +--------------------
 3 files changed, 89 insertions(+), 45 deletions(-)

diff --git a/pym/repoman/modules/scan/arches/__init__.py b/pym/repoman/modules/scan/arches/__init__.py
new file mode 100644
index 0000000..b570dac
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/__init__.py
@@ -0,0 +1,23 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Arches plug-in module for repoman.
+Performs archs checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'arches',
+	'description': doc,
+	'provides':{
+		'archs-module': {
+			'name': "arches",
+			'class': "ArchChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_desc': {
+			},
+		},
+	}
+}
+

diff --git a/pym/repoman/modules/scan/arches/arches.py b/pym/repoman/modules/scan/arches/arches.py
new file mode 100644
index 0000000..2c32028
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/arches.py
@@ -0,0 +1,64 @@
+# -*- coding:utf-8 -*-
+
+
+class ArchChecks(object):
+
+	def __init__(self, **kwargs):
+		self.options = kwargs.get('options')
+		self.repo_settings = kwargs.get('repo_settings')
+		self.profiles = kwargs.get('profiles')
+
+	def check(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		if self.options.ignore_arches:
+			arches = [[
+				self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
+				self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
+		else:
+			arches = set()
+			for keyword in ebuild.keywords:
+				if keyword[0] == "-":
+					continue
+				elif keyword[0] == "~":
+					arch = keyword[1:]
+					if arch == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (
+									expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, arch, (arch, keyword)))
+				else:
+					# For ebuilds with stable keywords, check if the
+					# dependencies are satisfiable for unstable
+					# configurations, since use.stable.mask is not
+					# applied for unstable configurations (see bug
+					# 563546).
+					if keyword == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (expanded_arch,)))
+							arches.add(
+								(keyword, expanded_arch,
+									(expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, keyword, (keyword,)))
+						arches.add((keyword, keyword,
+							(keyword, "~" + keyword)))
+			if not arches:
+				# Use an empty profile for checking dependencies of
+				# packages that have empty KEYWORDS.
+				arches.add(('**', '**', ('**',)))
+		return {'continue': False, 'arches': arches}
+
+	@property
+	def runInPkgs(self):
+		return (False, [])
+
+	@property
+	def runInEbuilds(self):
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 83193fd..7b07a95 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -301,6 +301,7 @@ class Scanner(object):
 				('eapi', 'EAPIChecks'), ('ebuild_metadata', 'EbuildMetadata'),
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
+				('arches', 'ArchChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -351,50 +352,6 @@ class Scanner(object):
 				self.liveeclasscheck.check(
 					dynamic_data['pkg'], xpkg, dynamic_data['ebuild'], y_ebuild, dynamic_data['ebuild'].keywords, self.repo_metadata['pmaskdict'])
 
-			if self.options.ignore_arches:
-				arches = [[
-					self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
-					self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
-			else:
-				arches = set()
-				for keyword in dynamic_data['ebuild'].keywords:
-					if keyword[0] == "-":
-						continue
-					elif keyword[0] == "~":
-						arch = keyword[1:]
-						if arch == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (
-										expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, arch, (arch, keyword)))
-					else:
-						# For ebuilds with stable keywords, check if the
-						# dependencies are satisfiable for unstable
-						# configurations, since use.stable.mask is not
-						# applied for unstable configurations (see bug
-						# 563546).
-						if keyword == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (expanded_arch,)))
-								arches.add(
-									(keyword, expanded_arch,
-										(expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, keyword, (keyword,)))
-							arches.add((keyword, keyword,
-								(keyword, "~" + keyword)))
-				if not arches:
-					# Use an empty profile for checking dependencies of
-					# packages that have empty KEYWORDS.
-					arches.add(('**', '**', ('**',)))
-
 			unknown_pkgs = set()
 			baddepsyntax = False
 			badlicsyntax = False
@@ -551,7 +508,7 @@ class Scanner(object):
 				continue
 
 			relevant_profiles = []
-			for keyword, arch, groups in arches:
+			for keyword, arch, groups in dynamic_data['arches']:
 				if arch not in self.profiles:
 					# A missing profile will create an error further down
 					# during the KEYWORDS verification.


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/arches/
@ 2016-01-18 19:23 Brian Dolbec
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Dolbec @ 2016-01-18 19:23 UTC (permalink / raw
  To: gentoo-commits

commit:     b392459cc67b64ab8cc0f75b6bdf554833a8b202
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  3 19:11:22 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Jan 18 19:20:03 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b392459c

repoman: Create a new ArchChecks class plugin

 pym/repoman/modules/scan/arches/__init__.py | 23 +++++++++++
 pym/repoman/modules/scan/arches/arches.py   | 64 +++++++++++++++++++++++++++++
 pym/repoman/scanner.py                      | 47 +--------------------
 3 files changed, 89 insertions(+), 45 deletions(-)

diff --git a/pym/repoman/modules/scan/arches/__init__.py b/pym/repoman/modules/scan/arches/__init__.py
new file mode 100644
index 0000000..b570dac
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/__init__.py
@@ -0,0 +1,23 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Arches plug-in module for repoman.
+Performs archs checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'arches',
+	'description': doc,
+	'provides':{
+		'archs-module': {
+			'name': "arches",
+			'class': "ArchChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_desc': {
+			},
+		},
+	}
+}
+

diff --git a/pym/repoman/modules/scan/arches/arches.py b/pym/repoman/modules/scan/arches/arches.py
new file mode 100644
index 0000000..2c32028
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/arches.py
@@ -0,0 +1,64 @@
+# -*- coding:utf-8 -*-
+
+
+class ArchChecks(object):
+
+	def __init__(self, **kwargs):
+		self.options = kwargs.get('options')
+		self.repo_settings = kwargs.get('repo_settings')
+		self.profiles = kwargs.get('profiles')
+
+	def check(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		if self.options.ignore_arches:
+			arches = [[
+				self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
+				self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
+		else:
+			arches = set()
+			for keyword in ebuild.keywords:
+				if keyword[0] == "-":
+					continue
+				elif keyword[0] == "~":
+					arch = keyword[1:]
+					if arch == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (
+									expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, arch, (arch, keyword)))
+				else:
+					# For ebuilds with stable keywords, check if the
+					# dependencies are satisfiable for unstable
+					# configurations, since use.stable.mask is not
+					# applied for unstable configurations (see bug
+					# 563546).
+					if keyword == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (expanded_arch,)))
+							arches.add(
+								(keyword, expanded_arch,
+									(expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, keyword, (keyword,)))
+						arches.add((keyword, keyword,
+							(keyword, "~" + keyword)))
+			if not arches:
+				# Use an empty profile for checking dependencies of
+				# packages that have empty KEYWORDS.
+				arches.add(('**', '**', ('**',)))
+		return {'continue': False, 'arches': arches}
+
+	@property
+	def runInPkgs(self):
+		return (False, [])
+
+	@property
+	def runInEbuilds(self):
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 83193fd..7b07a95 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -301,6 +301,7 @@ class Scanner(object):
 				('eapi', 'EAPIChecks'), ('ebuild_metadata', 'EbuildMetadata'),
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
+				('arches', 'ArchChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -351,50 +352,6 @@ class Scanner(object):
 				self.liveeclasscheck.check(
 					dynamic_data['pkg'], xpkg, dynamic_data['ebuild'], y_ebuild, dynamic_data['ebuild'].keywords, self.repo_metadata['pmaskdict'])
 
-			if self.options.ignore_arches:
-				arches = [[
-					self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
-					self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
-			else:
-				arches = set()
-				for keyword in dynamic_data['ebuild'].keywords:
-					if keyword[0] == "-":
-						continue
-					elif keyword[0] == "~":
-						arch = keyword[1:]
-						if arch == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (
-										expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, arch, (arch, keyword)))
-					else:
-						# For ebuilds with stable keywords, check if the
-						# dependencies are satisfiable for unstable
-						# configurations, since use.stable.mask is not
-						# applied for unstable configurations (see bug
-						# 563546).
-						if keyword == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (expanded_arch,)))
-								arches.add(
-									(keyword, expanded_arch,
-										(expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, keyword, (keyword,)))
-							arches.add((keyword, keyword,
-								(keyword, "~" + keyword)))
-				if not arches:
-					# Use an empty profile for checking dependencies of
-					# packages that have empty KEYWORDS.
-					arches.add(('**', '**', ('**',)))
-
 			unknown_pkgs = set()
 			baddepsyntax = False
 			badlicsyntax = False
@@ -551,7 +508,7 @@ class Scanner(object):
 				continue
 
 			relevant_profiles = []
-			for keyword, arch, groups in arches:
+			for keyword, arch, groups in dynamic_data['arches']:
 				if arch not in self.profiles:
 					# A missing profile will create an error further down
 					# during the KEYWORDS verification.


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/arches/
@ 2016-01-22 20:55 Brian Dolbec
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Dolbec @ 2016-01-22 20:55 UTC (permalink / raw
  To: gentoo-commits

commit:     85dd0fc4477d86b9e795b6a29990ffbf4a70c740
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  3 19:11:22 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Jan 22 18:44:11 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=85dd0fc4

repoman: Create a new ArchChecks class plugin

 pym/repoman/modules/scan/arches/__init__.py | 23 +++++++++++
 pym/repoman/modules/scan/arches/arches.py   | 64 +++++++++++++++++++++++++++++
 pym/repoman/scanner.py                      | 47 +--------------------
 3 files changed, 89 insertions(+), 45 deletions(-)

diff --git a/pym/repoman/modules/scan/arches/__init__.py b/pym/repoman/modules/scan/arches/__init__.py
new file mode 100644
index 0000000..b570dac
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/__init__.py
@@ -0,0 +1,23 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Arches plug-in module for repoman.
+Performs archs checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'arches',
+	'description': doc,
+	'provides':{
+		'archs-module': {
+			'name': "arches",
+			'class': "ArchChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_desc': {
+			},
+		},
+	}
+}
+

diff --git a/pym/repoman/modules/scan/arches/arches.py b/pym/repoman/modules/scan/arches/arches.py
new file mode 100644
index 0000000..2c32028
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/arches.py
@@ -0,0 +1,64 @@
+# -*- coding:utf-8 -*-
+
+
+class ArchChecks(object):
+
+	def __init__(self, **kwargs):
+		self.options = kwargs.get('options')
+		self.repo_settings = kwargs.get('repo_settings')
+		self.profiles = kwargs.get('profiles')
+
+	def check(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		if self.options.ignore_arches:
+			arches = [[
+				self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
+				self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
+		else:
+			arches = set()
+			for keyword in ebuild.keywords:
+				if keyword[0] == "-":
+					continue
+				elif keyword[0] == "~":
+					arch = keyword[1:]
+					if arch == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (
+									expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, arch, (arch, keyword)))
+				else:
+					# For ebuilds with stable keywords, check if the
+					# dependencies are satisfiable for unstable
+					# configurations, since use.stable.mask is not
+					# applied for unstable configurations (see bug
+					# 563546).
+					if keyword == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (expanded_arch,)))
+							arches.add(
+								(keyword, expanded_arch,
+									(expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, keyword, (keyword,)))
+						arches.add((keyword, keyword,
+							(keyword, "~" + keyword)))
+			if not arches:
+				# Use an empty profile for checking dependencies of
+				# packages that have empty KEYWORDS.
+				arches.add(('**', '**', ('**',)))
+		return {'continue': False, 'arches': arches}
+
+	@property
+	def runInPkgs(self):
+		return (False, [])
+
+	@property
+	def runInEbuilds(self):
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 83193fd..7b07a95 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -301,6 +301,7 @@ class Scanner(object):
 				('eapi', 'EAPIChecks'), ('ebuild_metadata', 'EbuildMetadata'),
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
+				('arches', 'ArchChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -351,50 +352,6 @@ class Scanner(object):
 				self.liveeclasscheck.check(
 					dynamic_data['pkg'], xpkg, dynamic_data['ebuild'], y_ebuild, dynamic_data['ebuild'].keywords, self.repo_metadata['pmaskdict'])
 
-			if self.options.ignore_arches:
-				arches = [[
-					self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
-					self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
-			else:
-				arches = set()
-				for keyword in dynamic_data['ebuild'].keywords:
-					if keyword[0] == "-":
-						continue
-					elif keyword[0] == "~":
-						arch = keyword[1:]
-						if arch == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (
-										expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, arch, (arch, keyword)))
-					else:
-						# For ebuilds with stable keywords, check if the
-						# dependencies are satisfiable for unstable
-						# configurations, since use.stable.mask is not
-						# applied for unstable configurations (see bug
-						# 563546).
-						if keyword == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (expanded_arch,)))
-								arches.add(
-									(keyword, expanded_arch,
-										(expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, keyword, (keyword,)))
-							arches.add((keyword, keyword,
-								(keyword, "~" + keyword)))
-				if not arches:
-					# Use an empty profile for checking dependencies of
-					# packages that have empty KEYWORDS.
-					arches.add(('**', '**', ('**',)))
-
 			unknown_pkgs = set()
 			baddepsyntax = False
 			badlicsyntax = False
@@ -551,7 +508,7 @@ class Scanner(object):
 				continue
 
 			relevant_profiles = []
-			for keyword, arch, groups in arches:
+			for keyword, arch, groups in dynamic_data['arches']:
 				if arch not in self.profiles:
 					# A missing profile will create an error further down
 					# during the KEYWORDS verification.


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/arches/
@ 2016-01-23  1:42 Brian Dolbec
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Dolbec @ 2016-01-23  1:42 UTC (permalink / raw
  To: gentoo-commits

commit:     832cc1cc734858dec86c7041d8f5af2a29677a65
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  3 19:11:22 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Jan 23 01:27:30 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=832cc1cc

repoman: Create a new ArchChecks class plugin

 pym/repoman/modules/scan/arches/__init__.py | 24 +++++++++++
 pym/repoman/modules/scan/arches/arches.py   | 64 +++++++++++++++++++++++++++++
 pym/repoman/scanner.py                      | 47 +--------------------
 3 files changed, 90 insertions(+), 45 deletions(-)

diff --git a/pym/repoman/modules/scan/arches/__init__.py b/pym/repoman/modules/scan/arches/__init__.py
new file mode 100644
index 0000000..d080c30
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/__init__.py
@@ -0,0 +1,24 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Arches plug-in module for repoman.
+Performs archs checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'arches',
+	'description': doc,
+	'provides':{
+		'archs-module': {
+			'name': "arches",
+			'sourcefile': "arches",
+			'class': "ArchChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_desc': {
+			},
+		},
+	}
+}
+

diff --git a/pym/repoman/modules/scan/arches/arches.py b/pym/repoman/modules/scan/arches/arches.py
new file mode 100644
index 0000000..2c32028
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/arches.py
@@ -0,0 +1,64 @@
+# -*- coding:utf-8 -*-
+
+
+class ArchChecks(object):
+
+	def __init__(self, **kwargs):
+		self.options = kwargs.get('options')
+		self.repo_settings = kwargs.get('repo_settings')
+		self.profiles = kwargs.get('profiles')
+
+	def check(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		if self.options.ignore_arches:
+			arches = [[
+				self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
+				self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
+		else:
+			arches = set()
+			for keyword in ebuild.keywords:
+				if keyword[0] == "-":
+					continue
+				elif keyword[0] == "~":
+					arch = keyword[1:]
+					if arch == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (
+									expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, arch, (arch, keyword)))
+				else:
+					# For ebuilds with stable keywords, check if the
+					# dependencies are satisfiable for unstable
+					# configurations, since use.stable.mask is not
+					# applied for unstable configurations (see bug
+					# 563546).
+					if keyword == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (expanded_arch,)))
+							arches.add(
+								(keyword, expanded_arch,
+									(expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, keyword, (keyword,)))
+						arches.add((keyword, keyword,
+							(keyword, "~" + keyword)))
+			if not arches:
+				# Use an empty profile for checking dependencies of
+				# packages that have empty KEYWORDS.
+				arches.add(('**', '**', ('**',)))
+		return {'continue': False, 'arches': arches}
+
+	@property
+	def runInPkgs(self):
+		return (False, [])
+
+	@property
+	def runInEbuilds(self):
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 83193fd..7b07a95 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -301,6 +301,7 @@ class Scanner(object):
 				('eapi', 'EAPIChecks'), ('ebuild_metadata', 'EbuildMetadata'),
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
+				('arches', 'ArchChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -351,50 +352,6 @@ class Scanner(object):
 				self.liveeclasscheck.check(
 					dynamic_data['pkg'], xpkg, dynamic_data['ebuild'], y_ebuild, dynamic_data['ebuild'].keywords, self.repo_metadata['pmaskdict'])
 
-			if self.options.ignore_arches:
-				arches = [[
-					self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
-					self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
-			else:
-				arches = set()
-				for keyword in dynamic_data['ebuild'].keywords:
-					if keyword[0] == "-":
-						continue
-					elif keyword[0] == "~":
-						arch = keyword[1:]
-						if arch == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (
-										expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, arch, (arch, keyword)))
-					else:
-						# For ebuilds with stable keywords, check if the
-						# dependencies are satisfiable for unstable
-						# configurations, since use.stable.mask is not
-						# applied for unstable configurations (see bug
-						# 563546).
-						if keyword == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (expanded_arch,)))
-								arches.add(
-									(keyword, expanded_arch,
-										(expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, keyword, (keyword,)))
-							arches.add((keyword, keyword,
-								(keyword, "~" + keyword)))
-				if not arches:
-					# Use an empty profile for checking dependencies of
-					# packages that have empty KEYWORDS.
-					arches.add(('**', '**', ('**',)))
-
 			unknown_pkgs = set()
 			baddepsyntax = False
 			badlicsyntax = False
@@ -551,7 +508,7 @@ class Scanner(object):
 				continue
 
 			relevant_profiles = []
-			for keyword, arch, groups in arches:
+			for keyword, arch, groups in dynamic_data['arches']:
 				if arch not in self.profiles:
 					# A missing profile will create an error further down
 					# during the KEYWORDS verification.


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/arches/
@ 2016-01-27 23:15 Brian Dolbec
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Dolbec @ 2016-01-27 23:15 UTC (permalink / raw
  To: gentoo-commits

commit:     c1bea69ecabc1fca0ae90def2afd4216ad5e9795
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  3 19:11:22 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Jan 27 22:44:22 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c1bea69e

repoman: Create a new ArchChecks class plugin

 pym/repoman/modules/scan/arches/__init__.py | 24 +++++++++++
 pym/repoman/modules/scan/arches/arches.py   | 64 +++++++++++++++++++++++++++++
 pym/repoman/scanner.py                      | 47 +--------------------
 3 files changed, 90 insertions(+), 45 deletions(-)

diff --git a/pym/repoman/modules/scan/arches/__init__.py b/pym/repoman/modules/scan/arches/__init__.py
new file mode 100644
index 0000000..d080c30
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/__init__.py
@@ -0,0 +1,24 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Arches plug-in module for repoman.
+Performs archs checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'arches',
+	'description': doc,
+	'provides':{
+		'archs-module': {
+			'name': "arches",
+			'sourcefile': "arches",
+			'class': "ArchChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_desc': {
+			},
+		},
+	}
+}
+

diff --git a/pym/repoman/modules/scan/arches/arches.py b/pym/repoman/modules/scan/arches/arches.py
new file mode 100644
index 0000000..2c32028
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/arches.py
@@ -0,0 +1,64 @@
+# -*- coding:utf-8 -*-
+
+
+class ArchChecks(object):
+
+	def __init__(self, **kwargs):
+		self.options = kwargs.get('options')
+		self.repo_settings = kwargs.get('repo_settings')
+		self.profiles = kwargs.get('profiles')
+
+	def check(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		if self.options.ignore_arches:
+			arches = [[
+				self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
+				self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
+		else:
+			arches = set()
+			for keyword in ebuild.keywords:
+				if keyword[0] == "-":
+					continue
+				elif keyword[0] == "~":
+					arch = keyword[1:]
+					if arch == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (
+									expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, arch, (arch, keyword)))
+				else:
+					# For ebuilds with stable keywords, check if the
+					# dependencies are satisfiable for unstable
+					# configurations, since use.stable.mask is not
+					# applied for unstable configurations (see bug
+					# 563546).
+					if keyword == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (expanded_arch,)))
+							arches.add(
+								(keyword, expanded_arch,
+									(expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, keyword, (keyword,)))
+						arches.add((keyword, keyword,
+							(keyword, "~" + keyword)))
+			if not arches:
+				# Use an empty profile for checking dependencies of
+				# packages that have empty KEYWORDS.
+				arches.add(('**', '**', ('**',)))
+		return {'continue': False, 'arches': arches}
+
+	@property
+	def runInPkgs(self):
+		return (False, [])
+
+	@property
+	def runInEbuilds(self):
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 6996f38..4cf7ca1 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -304,6 +304,7 @@ class Scanner(object):
 				('eapi', 'EAPIChecks'), ('ebuild_metadata', 'EbuildMetadata'),
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
+				('arches', 'ArchChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -354,50 +355,6 @@ class Scanner(object):
 				self.liveeclasscheck.check(
 					dynamic_data['pkg'], xpkg, dynamic_data['ebuild'], y_ebuild, dynamic_data['ebuild'].keywords, self.repo_metadata['pmaskdict'])
 
-			if self.options.ignore_arches:
-				arches = [[
-					self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
-					self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
-			else:
-				arches = set()
-				for keyword in dynamic_data['ebuild'].keywords:
-					if keyword[0] == "-":
-						continue
-					elif keyword[0] == "~":
-						arch = keyword[1:]
-						if arch == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (
-										expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, arch, (arch, keyword)))
-					else:
-						# For ebuilds with stable keywords, check if the
-						# dependencies are satisfiable for unstable
-						# configurations, since use.stable.mask is not
-						# applied for unstable configurations (see bug
-						# 563546).
-						if keyword == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (expanded_arch,)))
-								arches.add(
-									(keyword, expanded_arch,
-										(expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, keyword, (keyword,)))
-							arches.add((keyword, keyword,
-								(keyword, "~" + keyword)))
-				if not arches:
-					# Use an empty profile for checking dependencies of
-					# packages that have empty KEYWORDS.
-					arches.add(('**', '**', ('**',)))
-
 			unknown_pkgs = set()
 			baddepsyntax = False
 			badlicsyntax = False
@@ -554,7 +511,7 @@ class Scanner(object):
 				continue
 
 			relevant_profiles = []
-			for keyword, arch, groups in arches:
+			for keyword, arch, groups in dynamic_data['arches']:
 				if arch not in self.profiles:
 					# A missing profile will create an error further down
 					# during the KEYWORDS verification.


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/arches/
@ 2016-01-29  5:01 Brian Dolbec
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Dolbec @ 2016-01-29  5:01 UTC (permalink / raw
  To: gentoo-commits

commit:     d8c5126c9d911ebc1250d03891ee5678ad57ac55
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  3 19:11:22 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Jan 29 04:52:56 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d8c5126c

repoman: Create a new ArchChecks class plugin

 pym/repoman/modules/scan/arches/__init__.py | 24 +++++++++++
 pym/repoman/modules/scan/arches/arches.py   | 64 +++++++++++++++++++++++++++++
 pym/repoman/scanner.py                      | 47 +--------------------
 3 files changed, 90 insertions(+), 45 deletions(-)

diff --git a/pym/repoman/modules/scan/arches/__init__.py b/pym/repoman/modules/scan/arches/__init__.py
new file mode 100644
index 0000000..d080c30
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/__init__.py
@@ -0,0 +1,24 @@
+# Copyright 2015-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+doc = """Arches plug-in module for repoman.
+Performs archs checks on ebuilds."""
+__doc__ = doc[:]
+
+
+module_spec = {
+	'name': 'arches',
+	'description': doc,
+	'provides':{
+		'archs-module': {
+			'name': "arches",
+			'sourcefile': "arches",
+			'class': "ArchChecks",
+			'description': doc,
+			'functions': ['check'],
+			'func_desc': {
+			},
+		},
+	}
+}
+

diff --git a/pym/repoman/modules/scan/arches/arches.py b/pym/repoman/modules/scan/arches/arches.py
new file mode 100644
index 0000000..2c32028
--- /dev/null
+++ b/pym/repoman/modules/scan/arches/arches.py
@@ -0,0 +1,64 @@
+# -*- coding:utf-8 -*-
+
+
+class ArchChecks(object):
+
+	def __init__(self, **kwargs):
+		self.options = kwargs.get('options')
+		self.repo_settings = kwargs.get('repo_settings')
+		self.profiles = kwargs.get('profiles')
+
+	def check(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		if self.options.ignore_arches:
+			arches = [[
+				self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
+				self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
+		else:
+			arches = set()
+			for keyword in ebuild.keywords:
+				if keyword[0] == "-":
+					continue
+				elif keyword[0] == "~":
+					arch = keyword[1:]
+					if arch == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (
+									expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, arch, (arch, keyword)))
+				else:
+					# For ebuilds with stable keywords, check if the
+					# dependencies are satisfiable for unstable
+					# configurations, since use.stable.mask is not
+					# applied for unstable configurations (see bug
+					# 563546).
+					if keyword == "*":
+						for expanded_arch in self.profiles:
+							if expanded_arch == "**":
+								continue
+							arches.add(
+								(keyword, expanded_arch, (expanded_arch,)))
+							arches.add(
+								(keyword, expanded_arch,
+									(expanded_arch, "~" + expanded_arch)))
+					else:
+						arches.add((keyword, keyword, (keyword,)))
+						arches.add((keyword, keyword,
+							(keyword, "~" + keyword)))
+			if not arches:
+				# Use an empty profile for checking dependencies of
+				# packages that have empty KEYWORDS.
+				arches.add(('**', '**', ('**',)))
+		return {'continue': False, 'arches': arches}
+
+	@property
+	def runInPkgs(self):
+		return (False, [])
+
+	@property
+	def runInEbuilds(self):
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 6996f38..4cf7ca1 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -304,6 +304,7 @@ class Scanner(object):
 				('eapi', 'EAPIChecks'), ('ebuild_metadata', 'EbuildMetadata'),
 				('thirdpartymirrors', 'ThirdPartyMirrors'),
 				('description', 'DescriptionChecks'), (None, 'KeywordChecks'),
+				('arches', 'ArchChecks'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -354,50 +355,6 @@ class Scanner(object):
 				self.liveeclasscheck.check(
 					dynamic_data['pkg'], xpkg, dynamic_data['ebuild'], y_ebuild, dynamic_data['ebuild'].keywords, self.repo_metadata['pmaskdict'])
 
-			if self.options.ignore_arches:
-				arches = [[
-					self.repo_settings.repoman_settings["ARCH"], self.repo_settings.repoman_settings["ARCH"],
-					self.repo_settings.repoman_settings["ACCEPT_KEYWORDS"].split()]]
-			else:
-				arches = set()
-				for keyword in dynamic_data['ebuild'].keywords:
-					if keyword[0] == "-":
-						continue
-					elif keyword[0] == "~":
-						arch = keyword[1:]
-						if arch == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (
-										expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, arch, (arch, keyword)))
-					else:
-						# For ebuilds with stable keywords, check if the
-						# dependencies are satisfiable for unstable
-						# configurations, since use.stable.mask is not
-						# applied for unstable configurations (see bug
-						# 563546).
-						if keyword == "*":
-							for expanded_arch in self.profiles:
-								if expanded_arch == "**":
-									continue
-								arches.add(
-									(keyword, expanded_arch, (expanded_arch,)))
-								arches.add(
-									(keyword, expanded_arch,
-										(expanded_arch, "~" + expanded_arch)))
-						else:
-							arches.add((keyword, keyword, (keyword,)))
-							arches.add((keyword, keyword,
-								(keyword, "~" + keyword)))
-				if not arches:
-					# Use an empty profile for checking dependencies of
-					# packages that have empty KEYWORDS.
-					arches.add(('**', '**', ('**',)))
-
 			unknown_pkgs = set()
 			baddepsyntax = False
 			badlicsyntax = False
@@ -554,7 +511,7 @@ class Scanner(object):
 				continue
 
 			relevant_profiles = []
-			for keyword, arch, groups in arches:
+			for keyword, arch, groups in dynamic_data['arches']:
 				if arch not in self.profiles:
 					# A missing profile will create an error further down
 					# during the KEYWORDS verification.


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-01-29  5:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-27 23:15 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/arches/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2016-01-29  5:01 Brian Dolbec
2016-01-23  1:42 Brian Dolbec
2016-01-22 20:55 Brian Dolbec
2016-01-18 19:23 Brian Dolbec
2016-01-11  8:01 Brian Dolbec
2016-01-11  6:31 Brian Dolbec
2016-01-10  3:26 Brian Dolbec

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