public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2014-06-06 14:41 Tom Wijsman
  0 siblings, 0 replies; 28+ messages in thread
From: Tom Wijsman @ 2014-06-06 14:41 UTC (permalink / raw
  To: gentoo-commits

commit:     89ad2061c0af9ea711d4eae396d0d06356a780bc
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:40:39 2014 +0000
Commit:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
CommitDate: Fri Jun  6 14:40:39 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=89ad2061

repoman/main.py: Split EAPI checks to checks/ebuilds/variables/eapi.py

---
 pym/repoman/checks/ebuilds/variables/__init__.py |  0
 pym/repoman/checks/ebuilds/variables/eapi.py     | 44 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 12 +++----
 3 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/__init__.py b/pym/repoman/checks/ebuilds/variables/__init__.py
new file mode 100644
index 0000000..e69de29

diff --git a/pym/repoman/checks/ebuilds/variables/eapi.py b/pym/repoman/checks/ebuilds/variables/eapi.py
new file mode 100644
index 0000000..2f8b1cb
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/eapi.py
@@ -0,0 +1,44 @@
+
+'''eapi.py
+Perform checks on the EAPI variable.
+'''
+
+
+class EAPIChecks(object):
+	'''Perform checks on the EAPI variable.'''
+
+	def __init__(self, qatracker, repo_settings):
+		'''
+		@param qatracker: QATracker instance
+		@param repo_settings: Repository settings
+		'''
+		self.qatracker = qatracker
+		self.repo_settings = repo_settings
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		eapi = pkg._metadata["EAPI"]
+
+		if not self._checkBanned(ebuild, eapi):
+			self._checkDeprecated(ebuild, eapi)
+
+	def _checkBanned(self, ebuild, eapi):
+		if self.repo_settings.repo_config.eapi_is_banned(eapi):
+			self.qatracker.add_error(
+				"repo.eapi.banned", "%s: %s" % (ebuild.relative_path, eapi))
+
+			return True
+
+		return False
+
+	def _checkDeprecated(self, ebuild, eapi):
+		if self.repo_settings.repo_config.eapi_is_deprecated(eapi):
+			self.qatracker.add_error(
+				"repo.eapi.deprecated", "%s: %s" % (ebuild.relative_path, eapi))
+
+			return True
+
+		return False

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index c5d5276..92a9f51 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -51,6 +51,7 @@ from repoman.checks.ebuilds.manifests import Manifests
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -285,6 +286,7 @@ use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
+eapicheck = EAPIChecks(qatracker, repo_settings)
 ######################
 
 for xpkg in effective_scanlist:
@@ -386,13 +388,9 @@ for xpkg in effective_scanlist:
 		inherited = pkg.inherited
 		live_ebuild = live_eclasses.intersection(inherited)
 
-		if repo_settings.repo_config.eapi_is_banned(eapi):
-			qatracker.add_error(
-				"repo.eapi.banned", "%s: %s" % (ebuild.relative_path, eapi))
-
-		elif repo_settings.repo_config.eapi_is_deprecated(eapi):
-			qatracker.add_error(
-				"repo.eapi.deprecated", "%s: %s" % (ebuild.relative_path, eapi))
+		#######################
+		eapicheck.check(pkg, ebuild)
+		#######################
 
 		for k, v in myaux.items():
 			if not isinstance(v, basestring):


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2014-06-06 14:51 Tom Wijsman
  0 siblings, 0 replies; 28+ messages in thread
From: Tom Wijsman @ 2014-06-06 14:51 UTC (permalink / raw
  To: gentoo-commits

commit:     315cb3236f57ff7e60a2e77a35f3deb3878de39b
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:50:26 2014 +0000
Commit:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
CommitDate: Fri Jun  6 14:50:26 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=315cb323

repoman/main.py: Split DESCRIPTION checks to checks/ebuild/variables/

---
 .../checks/ebuilds/variables/description.py        | 40 ++++++++++++++++++++++
 pym/repoman/main.py                                | 19 ++++------
 2 files changed, 46 insertions(+), 13 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/description.py b/pym/repoman/checks/ebuilds/variables/description.py
new file mode 100644
index 0000000..fba8f97
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/description.py
@@ -0,0 +1,40 @@
+
+'''description.py
+Perform checks on the DESCRIPTION variable.
+'''
+
+from repoman.qa_data import max_desc_len
+
+
+class DescriptionChecks(object):
+	'''Perform checks on the DESCRIPTION variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		self._checkPunctuation(pkg, ebuild)
+		self._checkTooLong(pkg, ebuild)
+
+	def _checkPunctuation(self, pkg, ebuild):
+		if pkg._metadata['DESCRIPTION'][-1:] in ['.']:
+			self.qatracker.add_error(
+				'DESCRIPTION.punctuation',
+				"%s: DESCRIPTION ends with a '%s' character" %
+				(ebuild.relative_path, pkg._metadata['DESCRIPTION'][-1:]))
+
+	def _checkTooLong(self, pkg, ebuild):
+		# 14 is the length of DESCRIPTION=""
+		if len(pkg._metadata['DESCRIPTION']) > max_desc_len:
+			self.qatracker.add_error(
+				'DESCRIPTION.toolong',
+				"%s: DESCRIPTION is %d characters (max %d)" %
+				(ebuild.relative_path, len(
+					pkg._metadata['DESCRIPTION']), max_desc_len))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 92a9f51..83dfd07 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -51,6 +51,7 @@ from repoman.checks.ebuilds.manifests import Manifests
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
@@ -58,7 +59,7 @@ from repoman.modules.commit import repochecks
 from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
-	qawarnings, qacats, max_desc_len, missingvars,
+	qawarnings, qacats, missingvars,
 	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
@@ -287,6 +288,7 @@ keywordcheck = KeywordChecks(qatracker)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
+descriptioncheck = DescriptionChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -426,18 +428,9 @@ for xpkg in effective_scanlist:
 					myqakey = var + ".virtual"
 					qatracker.add_error(myqakey, ebuild.relative_path)
 
-		if myaux['DESCRIPTION'][-1:] in ['.']:
-			qatracker.add_error(
-				'DESCRIPTION.punctuation',
-				"%s: DESCRIPTION ends with a '%s' character" %
-				(ebuild.relative_path, myaux['DESCRIPTION'][-1:]))
-
-		# 14 is the length of DESCRIPTION=""
-		if len(myaux['DESCRIPTION']) > max_desc_len:
-			qatracker.add_error(
-				'DESCRIPTION.toolong',
-				"%s: DESCRIPTION is %d characters (max %d)" %
-				(ebuild.relative_path, len(myaux['DESCRIPTION']), max_desc_len))
+		#######################
+		descriptioncheck.check(pkg, ebuild)
+		#######################
 
 		keywords = myaux["KEYWORDS"].split()
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2014-06-06 15:10 Tom Wijsman
  0 siblings, 0 replies; 28+ messages in thread
From: Tom Wijsman @ 2014-06-06 15:10 UTC (permalink / raw
  To: gentoo-commits

commit:     60fbda473665c8b4d5adf00323923538adc6357e
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:09:43 2014 +0000
Commit:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
CommitDate: Fri Jun  6 15:09:43 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=60fbda47

repoman/main.py: Split LICENSE checks to checks/ebuild/variables/

---
 pym/repoman/checks/ebuilds/variables/license.py | 47 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 21 +++--------
 2 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/license.py b/pym/repoman/checks/ebuilds/variables/license.py
new file mode 100644
index 0000000..bdc859c
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/license.py
@@ -0,0 +1,47 @@
+
+'''description.py
+Perform checks on the LICENSE variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+
+class LicenseChecks(object):
+	'''Perform checks on the LICENSE variable.'''
+
+	def __init__(self, qatracker, liclist, liclist_deprecated):
+		'''
+		@param qatracker: QATracker instance
+		@param liclist: List of licenses.
+		@param liclist: List of deprecated licenses.
+		'''
+		self.qatracker = qatracker
+		self.liclist = liclist
+		self.liclist_deprecated = liclist_deprecated
+
+	def check(
+		self, pkg, package, ebuild, y_ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param package: Package in which we check (string).
+		@param ebuild: Ebuild which we check (object).
+		@param y_ebuild: Ebuild which we check (string).
+		'''
+
+		# Parse the LICENSE variable, remove USE conditions and flatten it.
+		licenses = portage.dep.use_reduce(
+			pkg._metadata["LICENSE"], matchall=1, flat=True)
+
+		# Check each entry to ensure that it exists in ${PORTDIR}/licenses/.
+		for lic in licenses:
+			# Need to check for "||" manually as no portage
+			# function will remove it without removing values.
+			if lic not in self.liclist and lic != "||":
+				self.qatracker.add_error(
+					"LICENSE.invalid",
+					package + "/" + y_ebuild + ".ebuild: %s" % lic)
+			elif lic in self.liclist_deprecated:
+				self.qatracker.add_error(
+					"LICENSE.deprecated",
+					"%s: %s" % (ebuild.relative_path, lic))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 83dfd07..6667d6b 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -53,6 +53,7 @@ from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
+from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -289,6 +290,7 @@ liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
+licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
 ######################
 
 for xpkg in effective_scanlist:
@@ -597,22 +599,9 @@ for xpkg in effective_scanlist:
 
 		# license checks
 		if not badlicsyntax:
-			# Parse the LICENSE variable, remove USE conditions and
-			# flatten it.
-			licenses = portage.dep.use_reduce(myaux["LICENSE"], matchall=1, flat=True)
-			# Check each entry to ensure that it exists in PORTDIR's
-			# license directory.
-			for lic in licenses:
-				# Need to check for "||" manually as no portage
-				# function will remove it without removing values.
-				if lic not in liclist and lic != "||":
-					qatracker.add_error(
-						"LICENSE.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % lic)
-				elif lic in liclist_deprecated:
-					qatracker.add_error(
-						"LICENSE.deprecated",
-						"%s: %s" % (ebuild.relative_path, lic))
+			#################
+			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
+			#################
 
 		# restrict checks
 		myrestrict = None


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2014-06-06 15:24 Tom Wijsman
  0 siblings, 0 replies; 28+ messages in thread
From: Tom Wijsman @ 2014-06-06 15:24 UTC (permalink / raw
  To: gentoo-commits

commit:     6d4cf83b8927d887f2d751251e504fee4d452b38
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:23:33 2014 +0000
Commit:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
CommitDate: Fri Jun  6 15:23:33 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6d4cf83b

repoman/main.py: Split RESTRICT checks to checks/ebuild/variables/

---
 pym/repoman/checks/ebuilds/variables/restrict.py | 41 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 25 ++++-----------
 2 files changed, 47 insertions(+), 19 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/restrict.py b/pym/repoman/checks/ebuilds/variables/restrict.py
new file mode 100644
index 0000000..215b792
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/restrict.py
@@ -0,0 +1,41 @@
+
+'''restrict.py
+Perform checks on the RESTRICT variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+from repoman.qa_data import valid_restrict
+
+
+class RestrictChecks(object):
+	'''Perform checks on the RESTRICT variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild):
+		myrestrict = None
+
+		try:
+			myrestrict = portage.dep.use_reduce(
+				pkg._metadata["RESTRICT"], matchall=1, flat=True)
+		except portage.exception.InvalidDependString as e:
+			self. qatracker.add_error(
+				"RESTRICT.syntax",
+				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
+			del e
+
+		if myrestrict:
+			myrestrict = set(myrestrict)
+			mybadrestrict = myrestrict.difference(valid_restrict)
+
+			if mybadrestrict:
+				for mybad in mybadrestrict:
+					self.qatracker.add_error(
+						"RESTRICT.invalid",
+						package + "/" + y_ebuild + ".ebuild: %s" % mybad)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 6667d6b..f56426b 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -54,6 +54,7 @@ from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
+from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -61,7 +62,7 @@ from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, missingvars,
-	suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -291,6 +292,7 @@ rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
 licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
+restrictcheck = RestrictChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -603,24 +605,9 @@ for xpkg in effective_scanlist:
 			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
 			#################
 
-		# restrict checks
-		myrestrict = None
-		try:
-			myrestrict = portage.dep.use_reduce(
-				myaux["RESTRICT"], matchall=1, flat=True)
-		except portage.exception.InvalidDependString as e:
-			qatracker.add_error(
-				"RESTRICT.syntax",
-				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
-			del e
-		if myrestrict:
-			myrestrict = set(myrestrict)
-			mybadrestrict = myrestrict.difference(valid_restrict)
-			if mybadrestrict:
-				for mybad in mybadrestrict:
-					qatracker.add_error(
-						"RESTRICT.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % mybad)
+		#################
+		restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
+		#################
 
 		# Syntax Checks
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2014-10-01 23:02 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2014-10-01 23:02 UTC (permalink / raw
  To: gentoo-commits

commit:     c9e4859648c65b1b220814917b0d96287fae4634
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:09:43 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Oct  1 22:58:14 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c9e48596

repoman/main.py: Split LICENSE checks to checks/ebuild/variables/

---
 pym/repoman/checks/ebuilds/variables/license.py | 47 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 21 +++--------
 2 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/license.py b/pym/repoman/checks/ebuilds/variables/license.py
new file mode 100644
index 0000000..bdc859c
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/license.py
@@ -0,0 +1,47 @@
+
+'''description.py
+Perform checks on the LICENSE variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+
+class LicenseChecks(object):
+	'''Perform checks on the LICENSE variable.'''
+
+	def __init__(self, qatracker, liclist, liclist_deprecated):
+		'''
+		@param qatracker: QATracker instance
+		@param liclist: List of licenses.
+		@param liclist: List of deprecated licenses.
+		'''
+		self.qatracker = qatracker
+		self.liclist = liclist
+		self.liclist_deprecated = liclist_deprecated
+
+	def check(
+		self, pkg, package, ebuild, y_ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param package: Package in which we check (string).
+		@param ebuild: Ebuild which we check (object).
+		@param y_ebuild: Ebuild which we check (string).
+		'''
+
+		# Parse the LICENSE variable, remove USE conditions and flatten it.
+		licenses = portage.dep.use_reduce(
+			pkg._metadata["LICENSE"], matchall=1, flat=True)
+
+		# Check each entry to ensure that it exists in ${PORTDIR}/licenses/.
+		for lic in licenses:
+			# Need to check for "||" manually as no portage
+			# function will remove it without removing values.
+			if lic not in self.liclist and lic != "||":
+				self.qatracker.add_error(
+					"LICENSE.invalid",
+					package + "/" + y_ebuild + ".ebuild: %s" % lic)
+			elif lic in self.liclist_deprecated:
+				self.qatracker.add_error(
+					"LICENSE.deprecated",
+					"%s: %s" % (ebuild.relative_path, lic))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index ed3cf88..722de79 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -60,6 +60,7 @@ from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
+from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -296,6 +297,7 @@ liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
+licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
 ######################
 
 for xpkg in effective_scanlist:
@@ -611,22 +613,9 @@ for xpkg in effective_scanlist:
 
 		# license checks
 		if not badlicsyntax:
-			# Parse the LICENSE variable, remove USE conditions and
-			# flatten it.
-			licenses = portage.dep.use_reduce(myaux["LICENSE"], matchall=1, flat=True)
-			# Check each entry to ensure that it exists in PORTDIR's
-			# license directory.
-			for lic in licenses:
-				# Need to check for "||" manually as no portage
-				# function will remove it without removing values.
-				if lic not in liclist and lic != "||":
-					qatracker.add_error(
-						"LICENSE.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % lic)
-				elif lic in liclist_deprecated:
-					qatracker.add_error(
-						"LICENSE.deprecated",
-						"%s: %s" % (ebuild.relative_path, lic))
+			#################
+			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
+			#################
 
 		# restrict checks
 		myrestrict = None


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2014-10-01 23:02 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2014-10-01 23:02 UTC (permalink / raw
  To: gentoo-commits

commit:     b1b87fbf2648bd1030ecac0375be622d0a181336
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:50:26 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Oct  1 22:58:14 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b1b87fbf

repoman/main.py: Split DESCRIPTION checks to checks/ebuild/variables/

---
 .../checks/ebuilds/variables/description.py        | 32 ++++++++++++++++++++++
 pym/repoman/main.py                                | 13 ++++-----
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/description.py b/pym/repoman/checks/ebuilds/variables/description.py
new file mode 100644
index 0000000..a2b1057
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/description.py
@@ -0,0 +1,32 @@
+
+'''description.py
+Perform checks on the DESCRIPTION variable.
+'''
+
+from repoman.qa_data import max_desc_len
+
+
+class DescriptionChecks(object):
+	'''Perform checks on the DESCRIPTION variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		self._checkTooLong(pkg, ebuild)
+
+	def _checkTooLong(self, pkg, ebuild):
+		# 14 is the length of DESCRIPTION=""
+		if len(pkg._metadata['DESCRIPTION']) > max_desc_len:
+			self.qatracker.add_error(
+				'DESCRIPTION.toolong',
+				"%s: DESCRIPTION is %d characters (max %d)" %
+				(ebuild.relative_path, len(
+					pkg._metadata['DESCRIPTION']), max_desc_len))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index c6f38df..ed3cf88 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -58,6 +58,7 @@ from repoman.checks.ebuilds.manifests import Manifests
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
@@ -65,7 +66,7 @@ from repoman.modules.commit import repochecks
 from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
-	qawarnings, qacats, max_desc_len, missingvars,
+	qawarnings, qacats, missingvars,
 	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
@@ -294,6 +295,7 @@ keywordcheck = KeywordChecks(qatracker)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
+descriptioncheck = DescriptionChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -433,12 +435,9 @@ for xpkg in effective_scanlist:
 					myqakey = var + ".virtual"
 					qatracker.add_error(myqakey, ebuild.relative_path)
 
-		# 14 is the length of DESCRIPTION=""
-		if len(myaux['DESCRIPTION']) > max_desc_len:
-			qatracker.add_error(
-				'DESCRIPTION.toolong',
-				"%s: DESCRIPTION is %d characters (max %d)" %
-				(ebuild.relative_path, len(myaux['DESCRIPTION']), max_desc_len))
+		#######################
+		descriptioncheck.check(pkg, ebuild)
+		#######################
 
 		keywords = myaux["KEYWORDS"].split()
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2014-10-01 23:46 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2014-10-01 23:46 UTC (permalink / raw
  To: gentoo-commits

commit:     a7c9f77f9ab9321fe9beda0bbf7716f2b206405b
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:23:33 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Oct  1 23:45:35 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a7c9f77f

repoman/main.py: Split RESTRICT checks to checks/ebuild/variables/

---
 pym/repoman/checks/ebuilds/variables/restrict.py | 41 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 25 ++++-----------
 2 files changed, 47 insertions(+), 19 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/restrict.py b/pym/repoman/checks/ebuilds/variables/restrict.py
new file mode 100644
index 0000000..215b792
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/restrict.py
@@ -0,0 +1,41 @@
+
+'''restrict.py
+Perform checks on the RESTRICT variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+from repoman.qa_data import valid_restrict
+
+
+class RestrictChecks(object):
+	'''Perform checks on the RESTRICT variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild):
+		myrestrict = None
+
+		try:
+			myrestrict = portage.dep.use_reduce(
+				pkg._metadata["RESTRICT"], matchall=1, flat=True)
+		except portage.exception.InvalidDependString as e:
+			self. qatracker.add_error(
+				"RESTRICT.syntax",
+				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
+			del e
+
+		if myrestrict:
+			myrestrict = set(myrestrict)
+			mybadrestrict = myrestrict.difference(valid_restrict)
+
+			if mybadrestrict:
+				for mybad in mybadrestrict:
+					self.qatracker.add_error(
+						"RESTRICT.invalid",
+						package + "/" + y_ebuild + ".ebuild: %s" % mybad)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 722de79..b3e93bf 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
+from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -68,7 +69,7 @@ from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, missingvars,
-	suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -298,6 +299,7 @@ rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
 licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
+restrictcheck = RestrictChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -617,24 +619,9 @@ for xpkg in effective_scanlist:
 			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
 			#################
 
-		# restrict checks
-		myrestrict = None
-		try:
-			myrestrict = portage.dep.use_reduce(
-				myaux["RESTRICT"], matchall=1, flat=True)
-		except portage.exception.InvalidDependString as e:
-			qatracker.add_error(
-				"RESTRICT.syntax",
-				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
-			del e
-		if myrestrict:
-			myrestrict = set(myrestrict)
-			mybadrestrict = myrestrict.difference(valid_restrict)
-			if mybadrestrict:
-				for mybad in mybadrestrict:
-					qatracker.add_error(
-						"RESTRICT.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % mybad)
+		#################
+		restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
+		#################
 
 		# Syntax Checks
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2014-11-17  0:55 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2014-11-17  0:55 UTC (permalink / raw
  To: gentoo-commits

commit:     02ba205d4e1f2adebd184491c579e0f8d1a04a80
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:09:43 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Nov 17 00:53:14 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=02ba205d

repoman/main.py: Split LICENSE checks to checks/ebuild/variables/

---
 pym/repoman/checks/ebuilds/variables/license.py | 47 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 21 +++--------
 2 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/license.py b/pym/repoman/checks/ebuilds/variables/license.py
new file mode 100644
index 0000000..bdc859c
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/license.py
@@ -0,0 +1,47 @@
+
+'''description.py
+Perform checks on the LICENSE variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+
+class LicenseChecks(object):
+	'''Perform checks on the LICENSE variable.'''
+
+	def __init__(self, qatracker, liclist, liclist_deprecated):
+		'''
+		@param qatracker: QATracker instance
+		@param liclist: List of licenses.
+		@param liclist: List of deprecated licenses.
+		'''
+		self.qatracker = qatracker
+		self.liclist = liclist
+		self.liclist_deprecated = liclist_deprecated
+
+	def check(
+		self, pkg, package, ebuild, y_ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param package: Package in which we check (string).
+		@param ebuild: Ebuild which we check (object).
+		@param y_ebuild: Ebuild which we check (string).
+		'''
+
+		# Parse the LICENSE variable, remove USE conditions and flatten it.
+		licenses = portage.dep.use_reduce(
+			pkg._metadata["LICENSE"], matchall=1, flat=True)
+
+		# Check each entry to ensure that it exists in ${PORTDIR}/licenses/.
+		for lic in licenses:
+			# Need to check for "||" manually as no portage
+			# function will remove it without removing values.
+			if lic not in self.liclist and lic != "||":
+				self.qatracker.add_error(
+					"LICENSE.invalid",
+					package + "/" + y_ebuild + ".ebuild: %s" % lic)
+			elif lic in self.liclist_deprecated:
+				self.qatracker.add_error(
+					"LICENSE.deprecated",
+					"%s: %s" % (ebuild.relative_path, lic))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index ed3cf88..722de79 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -60,6 +60,7 @@ from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
+from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -296,6 +297,7 @@ liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
+licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
 ######################
 
 for xpkg in effective_scanlist:
@@ -611,22 +613,9 @@ for xpkg in effective_scanlist:
 
 		# license checks
 		if not badlicsyntax:
-			# Parse the LICENSE variable, remove USE conditions and
-			# flatten it.
-			licenses = portage.dep.use_reduce(myaux["LICENSE"], matchall=1, flat=True)
-			# Check each entry to ensure that it exists in PORTDIR's
-			# license directory.
-			for lic in licenses:
-				# Need to check for "||" manually as no portage
-				# function will remove it without removing values.
-				if lic not in liclist and lic != "||":
-					qatracker.add_error(
-						"LICENSE.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % lic)
-				elif lic in liclist_deprecated:
-					qatracker.add_error(
-						"LICENSE.deprecated",
-						"%s: %s" % (ebuild.relative_path, lic))
+			#################
+			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
+			#################
 
 		# restrict checks
 		myrestrict = None


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-08-10 13:44 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-08-10 13:44 UTC (permalink / raw
  To: gentoo-commits

commit:     67687b6540955db5a70607dcb1a122850af2dd1f
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:50:26 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Jul 21 05:47:30 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=67687b65

repoman/main.py: Split DESCRIPTION checks to checks/ebuild/variables/

 .../checks/ebuilds/variables/description.py        | 32 ++++++++++++++++++++++
 pym/repoman/main.py                                | 13 ++++-----
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/description.py b/pym/repoman/checks/ebuilds/variables/description.py
new file mode 100644
index 0000000..a2b1057
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/description.py
@@ -0,0 +1,32 @@
+
+'''description.py
+Perform checks on the DESCRIPTION variable.
+'''
+
+from repoman.qa_data import max_desc_len
+
+
+class DescriptionChecks(object):
+	'''Perform checks on the DESCRIPTION variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		self._checkTooLong(pkg, ebuild)
+
+	def _checkTooLong(self, pkg, ebuild):
+		# 14 is the length of DESCRIPTION=""
+		if len(pkg._metadata['DESCRIPTION']) > max_desc_len:
+			self.qatracker.add_error(
+				'DESCRIPTION.toolong',
+				"%s: DESCRIPTION is %d characters (max %d)" %
+				(ebuild.relative_path, len(
+					pkg._metadata['DESCRIPTION']), max_desc_len))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index deb3202..c75f7e8 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
@@ -68,7 +69,7 @@ from repoman.modules.commit import repochecks
 from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
-	qawarnings, qacats, max_desc_len, missingvars,
+	qawarnings, qacats, missingvars,
 	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
@@ -297,6 +298,7 @@ keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
+descriptioncheck = DescriptionChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -436,12 +438,9 @@ for xpkg in effective_scanlist:
 					myqakey = var + ".virtual"
 					qatracker.add_error(myqakey, ebuild.relative_path)
 
-		# 14 is the length of DESCRIPTION=""
-		if len(myaux['DESCRIPTION']) > max_desc_len:
-			qatracker.add_error(
-				'DESCRIPTION.toolong',
-				"%s: DESCRIPTION is %d characters (max %d)" %
-				(ebuild.relative_path, len(myaux['DESCRIPTION']), max_desc_len))
+		#######################
+		descriptioncheck.check(pkg, ebuild)
+		#######################
 
 		keywords = myaux["KEYWORDS"].split()
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-08-10 13:44 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-08-10 13:44 UTC (permalink / raw
  To: gentoo-commits

commit:     cd1922895bb714dbe9eae33668d6382a7e8ac485
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:23:33 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Jul 21 05:47:31 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cd192289

repoman/main.py: Split RESTRICT checks to checks/ebuild/variables/

 pym/repoman/checks/ebuilds/variables/restrict.py | 41 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 25 ++++-----------
 2 files changed, 47 insertions(+), 19 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/restrict.py b/pym/repoman/checks/ebuilds/variables/restrict.py
new file mode 100644
index 0000000..215b792
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/restrict.py
@@ -0,0 +1,41 @@
+
+'''restrict.py
+Perform checks on the RESTRICT variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+from repoman.qa_data import valid_restrict
+
+
+class RestrictChecks(object):
+	'''Perform checks on the RESTRICT variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild):
+		myrestrict = None
+
+		try:
+			myrestrict = portage.dep.use_reduce(
+				pkg._metadata["RESTRICT"], matchall=1, flat=True)
+		except portage.exception.InvalidDependString as e:
+			self. qatracker.add_error(
+				"RESTRICT.syntax",
+				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
+			del e
+
+		if myrestrict:
+			myrestrict = set(myrestrict)
+			mybadrestrict = myrestrict.difference(valid_restrict)
+
+			if mybadrestrict:
+				for mybad in mybadrestrict:
+					self.qatracker.add_error(
+						"RESTRICT.invalid",
+						package + "/" + y_ebuild + ".ebuild: %s" % mybad)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 7ed07c7..f34d8a7 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -64,6 +64,7 @@ from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
+from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -71,7 +72,7 @@ from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, missingvars,
-	suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -301,6 +302,7 @@ rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
 licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
+restrictcheck = RestrictChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -623,24 +625,9 @@ for xpkg in effective_scanlist:
 			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
 			#################
 
-		# restrict checks
-		myrestrict = None
-		try:
-			myrestrict = portage.dep.use_reduce(
-				myaux["RESTRICT"], matchall=1, flat=True)
-		except portage.exception.InvalidDependString as e:
-			qatracker.add_error(
-				"RESTRICT.syntax",
-				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
-			del e
-		if myrestrict:
-			myrestrict = set(myrestrict)
-			mybadrestrict = myrestrict.difference(valid_restrict)
-			if mybadrestrict:
-				for mybad in mybadrestrict:
-					qatracker.add_error(
-						"RESTRICT.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % mybad)
+		#################
+		restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
+		#################
 
 		# Syntax Checks
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-08-10 13:44 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-08-10 13:44 UTC (permalink / raw
  To: gentoo-commits

commit:     ea5a560f0652aec6ea724a6b43dc436fecd74d06
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:09:43 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Jul 21 05:47:31 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ea5a560f

repoman/main.py: Split LICENSE checks to checks/ebuild/variables/

 pym/repoman/checks/ebuilds/variables/license.py | 47 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 21 +++--------
 2 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/license.py b/pym/repoman/checks/ebuilds/variables/license.py
new file mode 100644
index 0000000..bdc859c
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/license.py
@@ -0,0 +1,47 @@
+
+'''description.py
+Perform checks on the LICENSE variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+
+class LicenseChecks(object):
+	'''Perform checks on the LICENSE variable.'''
+
+	def __init__(self, qatracker, liclist, liclist_deprecated):
+		'''
+		@param qatracker: QATracker instance
+		@param liclist: List of licenses.
+		@param liclist: List of deprecated licenses.
+		'''
+		self.qatracker = qatracker
+		self.liclist = liclist
+		self.liclist_deprecated = liclist_deprecated
+
+	def check(
+		self, pkg, package, ebuild, y_ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param package: Package in which we check (string).
+		@param ebuild: Ebuild which we check (object).
+		@param y_ebuild: Ebuild which we check (string).
+		'''
+
+		# Parse the LICENSE variable, remove USE conditions and flatten it.
+		licenses = portage.dep.use_reduce(
+			pkg._metadata["LICENSE"], matchall=1, flat=True)
+
+		# Check each entry to ensure that it exists in ${PORTDIR}/licenses/.
+		for lic in licenses:
+			# Need to check for "||" manually as no portage
+			# function will remove it without removing values.
+			if lic not in self.liclist and lic != "||":
+				self.qatracker.add_error(
+					"LICENSE.invalid",
+					package + "/" + y_ebuild + ".ebuild: %s" % lic)
+			elif lic in self.liclist_deprecated:
+				self.qatracker.add_error(
+					"LICENSE.deprecated",
+					"%s: %s" % (ebuild.relative_path, lic))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index c75f7e8..7ed07c7 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -63,6 +63,7 @@ from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
+from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -299,6 +300,7 @@ liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
+licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
 ######################
 
 for xpkg in effective_scanlist:
@@ -617,22 +619,9 @@ for xpkg in effective_scanlist:
 
 		# license checks
 		if not badlicsyntax:
-			# Parse the LICENSE variable, remove USE conditions and
-			# flatten it.
-			licenses = portage.dep.use_reduce(myaux["LICENSE"], matchall=1, flat=True)
-			# Check each entry to ensure that it exists in PORTDIR's
-			# license directory.
-			for lic in licenses:
-				# Need to check for "||" manually as no portage
-				# function will remove it without removing values.
-				if lic not in liclist and lic != "||":
-					qatracker.add_error(
-						"LICENSE.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % lic)
-				elif lic in liclist_deprecated:
-					qatracker.add_error(
-						"LICENSE.deprecated",
-						"%s: %s" % (ebuild.relative_path, lic))
+			#################
+			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
+			#################
 
 		# restrict checks
 		myrestrict = None


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-08-10 14:45 Michał Górny
  0 siblings, 0 replies; 28+ messages in thread
From: Michał Górny @ 2015-08-10 14:45 UTC (permalink / raw
  To: gentoo-commits

commit:     fa5761e5f36de72ddadb3dbc69019ac7e13bb678
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:50:26 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug 10 14:45:20 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fa5761e5

repoman/main.py: Split DESCRIPTION checks to checks/ebuild/variables/

 .../checks/ebuilds/variables/description.py        | 32 ++++++++++++++++++++++
 pym/repoman/main.py                                | 13 ++++-----
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/description.py b/pym/repoman/checks/ebuilds/variables/description.py
new file mode 100644
index 0000000..a2b1057
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/description.py
@@ -0,0 +1,32 @@
+
+'''description.py
+Perform checks on the DESCRIPTION variable.
+'''
+
+from repoman.qa_data import max_desc_len
+
+
+class DescriptionChecks(object):
+	'''Perform checks on the DESCRIPTION variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		self._checkTooLong(pkg, ebuild)
+
+	def _checkTooLong(self, pkg, ebuild):
+		# 14 is the length of DESCRIPTION=""
+		if len(pkg._metadata['DESCRIPTION']) > max_desc_len:
+			self.qatracker.add_error(
+				'DESCRIPTION.toolong',
+				"%s: DESCRIPTION is %d characters (max %d)" %
+				(ebuild.relative_path, len(
+					pkg._metadata['DESCRIPTION']), max_desc_len))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 70d2255..125b390 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
@@ -68,7 +69,7 @@ from repoman.modules.commit import repochecks
 from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
-	qawarnings, qacats, max_desc_len, missingvars,
+	qawarnings, qacats, missingvars,
 	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
@@ -297,6 +298,7 @@ keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
+descriptioncheck = DescriptionChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -436,12 +438,9 @@ for xpkg in effective_scanlist:
 					myqakey = var + ".virtual"
 					qatracker.add_error(myqakey, ebuild.relative_path)
 
-		# 14 is the length of DESCRIPTION=""
-		if len(myaux['DESCRIPTION']) > max_desc_len:
-			qatracker.add_error(
-				'DESCRIPTION.toolong',
-				"%s: DESCRIPTION is %d characters (max %d)" %
-				(ebuild.relative_path, len(myaux['DESCRIPTION']), max_desc_len))
+		#######################
+		descriptioncheck.check(pkg, ebuild)
+		#######################
 
 		keywords = myaux["KEYWORDS"].split()
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-08-10 14:45 Michał Górny
  0 siblings, 0 replies; 28+ messages in thread
From: Michał Górny @ 2015-08-10 14:45 UTC (permalink / raw
  To: gentoo-commits

commit:     46b3cf797ed96068c00b48d0e41d8cdda22929d9
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:23:33 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug 10 14:45:20 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=46b3cf79

repoman/main.py: Split RESTRICT checks to checks/ebuild/variables/

 pym/repoman/checks/ebuilds/variables/restrict.py | 41 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 25 ++++-----------
 2 files changed, 47 insertions(+), 19 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/restrict.py b/pym/repoman/checks/ebuilds/variables/restrict.py
new file mode 100644
index 0000000..215b792
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/restrict.py
@@ -0,0 +1,41 @@
+
+'''restrict.py
+Perform checks on the RESTRICT variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+from repoman.qa_data import valid_restrict
+
+
+class RestrictChecks(object):
+	'''Perform checks on the RESTRICT variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild):
+		myrestrict = None
+
+		try:
+			myrestrict = portage.dep.use_reduce(
+				pkg._metadata["RESTRICT"], matchall=1, flat=True)
+		except portage.exception.InvalidDependString as e:
+			self. qatracker.add_error(
+				"RESTRICT.syntax",
+				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
+			del e
+
+		if myrestrict:
+			myrestrict = set(myrestrict)
+			mybadrestrict = myrestrict.difference(valid_restrict)
+
+			if mybadrestrict:
+				for mybad in mybadrestrict:
+					self.qatracker.add_error(
+						"RESTRICT.invalid",
+						package + "/" + y_ebuild + ".ebuild: %s" % mybad)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 5fe7515..e98520b 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -64,6 +64,7 @@ from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
+from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -71,7 +72,7 @@ from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, missingvars,
-	suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -301,6 +302,7 @@ rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
 licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
+restrictcheck = RestrictChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -623,24 +625,9 @@ for xpkg in effective_scanlist:
 			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
 			#################
 
-		# restrict checks
-		myrestrict = None
-		try:
-			myrestrict = portage.dep.use_reduce(
-				myaux["RESTRICT"], matchall=1, flat=True)
-		except portage.exception.InvalidDependString as e:
-			qatracker.add_error(
-				"RESTRICT.syntax",
-				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
-			del e
-		if myrestrict:
-			myrestrict = set(myrestrict)
-			mybadrestrict = myrestrict.difference(valid_restrict)
-			if mybadrestrict:
-				for mybad in mybadrestrict:
-					qatracker.add_error(
-						"RESTRICT.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % mybad)
+		#################
+		restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
+		#################
 
 		# Syntax Checks
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-08-11 23:54 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-08-11 23:54 UTC (permalink / raw
  To: gentoo-commits

commit:     c0711495b0612f5eac76a5ef2be229d2240bef34
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:50:26 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Aug 11 23:52:56 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c0711495

repoman/main.py: Split DESCRIPTION checks to checks/ebuild/variables/

 .../checks/ebuilds/variables/description.py        | 32 ++++++++++++++++++++++
 pym/repoman/main.py                                | 13 ++++-----
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/description.py b/pym/repoman/checks/ebuilds/variables/description.py
new file mode 100644
index 0000000..a2b1057
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/description.py
@@ -0,0 +1,32 @@
+
+'''description.py
+Perform checks on the DESCRIPTION variable.
+'''
+
+from repoman.qa_data import max_desc_len
+
+
+class DescriptionChecks(object):
+	'''Perform checks on the DESCRIPTION variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		self._checkTooLong(pkg, ebuild)
+
+	def _checkTooLong(self, pkg, ebuild):
+		# 14 is the length of DESCRIPTION=""
+		if len(pkg._metadata['DESCRIPTION']) > max_desc_len:
+			self.qatracker.add_error(
+				'DESCRIPTION.toolong',
+				"%s: DESCRIPTION is %d characters (max %d)" %
+				(ebuild.relative_path, len(
+					pkg._metadata['DESCRIPTION']), max_desc_len))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 70d2255..125b390 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
@@ -68,7 +69,7 @@ from repoman.modules.commit import repochecks
 from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
-	qawarnings, qacats, max_desc_len, missingvars,
+	qawarnings, qacats, missingvars,
 	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
@@ -297,6 +298,7 @@ keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
+descriptioncheck = DescriptionChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -436,12 +438,9 @@ for xpkg in effective_scanlist:
 					myqakey = var + ".virtual"
 					qatracker.add_error(myqakey, ebuild.relative_path)
 
-		# 14 is the length of DESCRIPTION=""
-		if len(myaux['DESCRIPTION']) > max_desc_len:
-			qatracker.add_error(
-				'DESCRIPTION.toolong',
-				"%s: DESCRIPTION is %d characters (max %d)" %
-				(ebuild.relative_path, len(myaux['DESCRIPTION']), max_desc_len))
+		#######################
+		descriptioncheck.check(pkg, ebuild)
+		#######################
 
 		keywords = myaux["KEYWORDS"].split()
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-08-11 23:54 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-08-11 23:54 UTC (permalink / raw
  To: gentoo-commits

commit:     f93a28a906c018201bdcff6288d4d882d51e4dc4
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:40:39 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Aug 11 23:52:56 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f93a28a9

repoman/main.py: Split EAPI checks to checks/ebuilds/variables/eapi.py

 pym/repoman/checks/ebuilds/variables/__init__.py |  0
 pym/repoman/checks/ebuilds/variables/eapi.py     | 44 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 12 +++----
 3 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/__init__.py b/pym/repoman/checks/ebuilds/variables/__init__.py
new file mode 100644
index 0000000..e69de29

diff --git a/pym/repoman/checks/ebuilds/variables/eapi.py b/pym/repoman/checks/ebuilds/variables/eapi.py
new file mode 100644
index 0000000..2f8b1cb
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/eapi.py
@@ -0,0 +1,44 @@
+
+'''eapi.py
+Perform checks on the EAPI variable.
+'''
+
+
+class EAPIChecks(object):
+	'''Perform checks on the EAPI variable.'''
+
+	def __init__(self, qatracker, repo_settings):
+		'''
+		@param qatracker: QATracker instance
+		@param repo_settings: Repository settings
+		'''
+		self.qatracker = qatracker
+		self.repo_settings = repo_settings
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		eapi = pkg._metadata["EAPI"]
+
+		if not self._checkBanned(ebuild, eapi):
+			self._checkDeprecated(ebuild, eapi)
+
+	def _checkBanned(self, ebuild, eapi):
+		if self.repo_settings.repo_config.eapi_is_banned(eapi):
+			self.qatracker.add_error(
+				"repo.eapi.banned", "%s: %s" % (ebuild.relative_path, eapi))
+
+			return True
+
+		return False
+
+	def _checkDeprecated(self, ebuild, eapi):
+		if self.repo_settings.repo_config.eapi_is_deprecated(eapi):
+			self.qatracker.add_error(
+				"repo.eapi.deprecated", "%s: %s" % (ebuild.relative_path, eapi))
+
+			return True
+
+		return False

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 2523544..70d2255 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -295,6 +296,7 @@ use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
+eapicheck = EAPIChecks(qatracker, repo_settings)
 ######################
 
 for xpkg in effective_scanlist:
@@ -396,13 +398,9 @@ for xpkg in effective_scanlist:
 		inherited = pkg.inherited
 		live_ebuild = live_eclasses.intersection(inherited)
 
-		if repo_settings.repo_config.eapi_is_banned(eapi):
-			qatracker.add_error(
-				"repo.eapi.banned", "%s: %s" % (ebuild.relative_path, eapi))
-
-		elif repo_settings.repo_config.eapi_is_deprecated(eapi):
-			qatracker.add_error(
-				"repo.eapi.deprecated", "%s: %s" % (ebuild.relative_path, eapi))
+		#######################
+		eapicheck.check(pkg, ebuild)
+		#######################
 
 		for k, v in myaux.items():
 			if not isinstance(v, basestring):


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-05 21:27 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-05 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     7b2e3e7d0c05321af552fb57eed04b4aaee61f72
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:40:39 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep  5 21:27:00 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7b2e3e7d

repoman/main.py: Split EAPI checks to checks/ebuilds/variables/eapi.py

 pym/repoman/checks/ebuilds/variables/__init__.py |  0
 pym/repoman/checks/ebuilds/variables/eapi.py     | 44 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 12 +++----
 3 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/__init__.py b/pym/repoman/checks/ebuilds/variables/__init__.py
new file mode 100644
index 0000000..e69de29

diff --git a/pym/repoman/checks/ebuilds/variables/eapi.py b/pym/repoman/checks/ebuilds/variables/eapi.py
new file mode 100644
index 0000000..2f8b1cb
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/eapi.py
@@ -0,0 +1,44 @@
+
+'''eapi.py
+Perform checks on the EAPI variable.
+'''
+
+
+class EAPIChecks(object):
+	'''Perform checks on the EAPI variable.'''
+
+	def __init__(self, qatracker, repo_settings):
+		'''
+		@param qatracker: QATracker instance
+		@param repo_settings: Repository settings
+		'''
+		self.qatracker = qatracker
+		self.repo_settings = repo_settings
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		eapi = pkg._metadata["EAPI"]
+
+		if not self._checkBanned(ebuild, eapi):
+			self._checkDeprecated(ebuild, eapi)
+
+	def _checkBanned(self, ebuild, eapi):
+		if self.repo_settings.repo_config.eapi_is_banned(eapi):
+			self.qatracker.add_error(
+				"repo.eapi.banned", "%s: %s" % (ebuild.relative_path, eapi))
+
+			return True
+
+		return False
+
+	def _checkDeprecated(self, ebuild, eapi):
+		if self.repo_settings.repo_config.eapi_is_deprecated(eapi):
+			self.qatracker.add_error(
+				"repo.eapi.deprecated", "%s: %s" % (ebuild.relative_path, eapi))
+
+			return True
+
+		return False

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 2523544..70d2255 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -295,6 +296,7 @@ use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
+eapicheck = EAPIChecks(qatracker, repo_settings)
 ######################
 
 for xpkg in effective_scanlist:
@@ -396,13 +398,9 @@ for xpkg in effective_scanlist:
 		inherited = pkg.inherited
 		live_ebuild = live_eclasses.intersection(inherited)
 
-		if repo_settings.repo_config.eapi_is_banned(eapi):
-			qatracker.add_error(
-				"repo.eapi.banned", "%s: %s" % (ebuild.relative_path, eapi))
-
-		elif repo_settings.repo_config.eapi_is_deprecated(eapi):
-			qatracker.add_error(
-				"repo.eapi.deprecated", "%s: %s" % (ebuild.relative_path, eapi))
+		#######################
+		eapicheck.check(pkg, ebuild)
+		#######################
 
 		for k, v in myaux.items():
 			if not isinstance(v, basestring):


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-05 21:27 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-05 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     38c86e616154eae5505781efbc5cb4f380029e24
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:23:33 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep  5 21:27:00 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=38c86e61

repoman/main.py: Split RESTRICT checks to checks/ebuild/variables/

 pym/repoman/checks/ebuilds/variables/restrict.py | 41 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 25 ++++-----------
 2 files changed, 47 insertions(+), 19 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/restrict.py b/pym/repoman/checks/ebuilds/variables/restrict.py
new file mode 100644
index 0000000..215b792
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/restrict.py
@@ -0,0 +1,41 @@
+
+'''restrict.py
+Perform checks on the RESTRICT variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+from repoman.qa_data import valid_restrict
+
+
+class RestrictChecks(object):
+	'''Perform checks on the RESTRICT variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild):
+		myrestrict = None
+
+		try:
+			myrestrict = portage.dep.use_reduce(
+				pkg._metadata["RESTRICT"], matchall=1, flat=True)
+		except portage.exception.InvalidDependString as e:
+			self. qatracker.add_error(
+				"RESTRICT.syntax",
+				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
+			del e
+
+		if myrestrict:
+			myrestrict = set(myrestrict)
+			mybadrestrict = myrestrict.difference(valid_restrict)
+
+			if mybadrestrict:
+				for mybad in mybadrestrict:
+					self.qatracker.add_error(
+						"RESTRICT.invalid",
+						package + "/" + y_ebuild + ".ebuild: %s" % mybad)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 5fe7515..e98520b 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -64,6 +64,7 @@ from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
+from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -71,7 +72,7 @@ from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, missingvars,
-	suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -301,6 +302,7 @@ rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
 licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
+restrictcheck = RestrictChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -623,24 +625,9 @@ for xpkg in effective_scanlist:
 			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
 			#################
 
-		# restrict checks
-		myrestrict = None
-		try:
-			myrestrict = portage.dep.use_reduce(
-				myaux["RESTRICT"], matchall=1, flat=True)
-		except portage.exception.InvalidDependString as e:
-			qatracker.add_error(
-				"RESTRICT.syntax",
-				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
-			del e
-		if myrestrict:
-			myrestrict = set(myrestrict)
-			mybadrestrict = myrestrict.difference(valid_restrict)
-			if mybadrestrict:
-				for mybad in mybadrestrict:
-					qatracker.add_error(
-						"RESTRICT.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % mybad)
+		#################
+		restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
+		#################
 
 		# Syntax Checks
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-05 21:27 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-05 21:27 UTC (permalink / raw
  To: gentoo-commits

commit:     c258dfab547502e2213256ff1346ff1f1c4f52a5
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:09:43 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep  5 21:27:00 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c258dfab

repoman/main.py: Split LICENSE checks to checks/ebuild/variables/

 pym/repoman/checks/ebuilds/variables/license.py | 47 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 21 +++--------
 2 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/license.py b/pym/repoman/checks/ebuilds/variables/license.py
new file mode 100644
index 0000000..bdc859c
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/license.py
@@ -0,0 +1,47 @@
+
+'''description.py
+Perform checks on the LICENSE variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+
+class LicenseChecks(object):
+	'''Perform checks on the LICENSE variable.'''
+
+	def __init__(self, qatracker, liclist, liclist_deprecated):
+		'''
+		@param qatracker: QATracker instance
+		@param liclist: List of licenses.
+		@param liclist: List of deprecated licenses.
+		'''
+		self.qatracker = qatracker
+		self.liclist = liclist
+		self.liclist_deprecated = liclist_deprecated
+
+	def check(
+		self, pkg, package, ebuild, y_ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param package: Package in which we check (string).
+		@param ebuild: Ebuild which we check (object).
+		@param y_ebuild: Ebuild which we check (string).
+		'''
+
+		# Parse the LICENSE variable, remove USE conditions and flatten it.
+		licenses = portage.dep.use_reduce(
+			pkg._metadata["LICENSE"], matchall=1, flat=True)
+
+		# Check each entry to ensure that it exists in ${PORTDIR}/licenses/.
+		for lic in licenses:
+			# Need to check for "||" manually as no portage
+			# function will remove it without removing values.
+			if lic not in self.liclist and lic != "||":
+				self.qatracker.add_error(
+					"LICENSE.invalid",
+					package + "/" + y_ebuild + ".ebuild: %s" % lic)
+			elif lic in self.liclist_deprecated:
+				self.qatracker.add_error(
+					"LICENSE.deprecated",
+					"%s: %s" % (ebuild.relative_path, lic))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 125b390..5fe7515 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -63,6 +63,7 @@ from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
+from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -299,6 +300,7 @@ liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
+licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
 ######################
 
 for xpkg in effective_scanlist:
@@ -617,22 +619,9 @@ for xpkg in effective_scanlist:
 
 		# license checks
 		if not badlicsyntax:
-			# Parse the LICENSE variable, remove USE conditions and
-			# flatten it.
-			licenses = portage.dep.use_reduce(myaux["LICENSE"], matchall=1, flat=True)
-			# Check each entry to ensure that it exists in PORTDIR's
-			# license directory.
-			for lic in licenses:
-				# Need to check for "||" manually as no portage
-				# function will remove it without removing values.
-				if lic not in liclist and lic != "||":
-					qatracker.add_error(
-						"LICENSE.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % lic)
-				elif lic in liclist_deprecated:
-					qatracker.add_error(
-						"LICENSE.deprecated",
-						"%s: %s" % (ebuild.relative_path, lic))
+			#################
+			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
+			#################
 
 		# restrict checks
 		myrestrict = None


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-05 21:48 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-05 21:48 UTC (permalink / raw
  To: gentoo-commits

commit:     1346f715f98160c96204b063a18720c17dae62af
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:40:39 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep  5 21:47:38 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1346f715

repoman/main.py: Split EAPI checks to checks/ebuilds/variables/eapi.py

 pym/repoman/checks/ebuilds/variables/__init__.py |  0
 pym/repoman/checks/ebuilds/variables/eapi.py     | 44 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 12 +++----
 3 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/__init__.py b/pym/repoman/checks/ebuilds/variables/__init__.py
new file mode 100644
index 0000000..e69de29

diff --git a/pym/repoman/checks/ebuilds/variables/eapi.py b/pym/repoman/checks/ebuilds/variables/eapi.py
new file mode 100644
index 0000000..2f8b1cb
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/eapi.py
@@ -0,0 +1,44 @@
+
+'''eapi.py
+Perform checks on the EAPI variable.
+'''
+
+
+class EAPIChecks(object):
+	'''Perform checks on the EAPI variable.'''
+
+	def __init__(self, qatracker, repo_settings):
+		'''
+		@param qatracker: QATracker instance
+		@param repo_settings: Repository settings
+		'''
+		self.qatracker = qatracker
+		self.repo_settings = repo_settings
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		eapi = pkg._metadata["EAPI"]
+
+		if not self._checkBanned(ebuild, eapi):
+			self._checkDeprecated(ebuild, eapi)
+
+	def _checkBanned(self, ebuild, eapi):
+		if self.repo_settings.repo_config.eapi_is_banned(eapi):
+			self.qatracker.add_error(
+				"repo.eapi.banned", "%s: %s" % (ebuild.relative_path, eapi))
+
+			return True
+
+		return False
+
+	def _checkDeprecated(self, ebuild, eapi):
+		if self.repo_settings.repo_config.eapi_is_deprecated(eapi):
+			self.qatracker.add_error(
+				"repo.eapi.deprecated", "%s: %s" % (ebuild.relative_path, eapi))
+
+			return True
+
+		return False

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index bacc25f..6bfd1be 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -295,6 +296,7 @@ use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
+eapicheck = EAPIChecks(qatracker, repo_settings)
 ######################
 
 for xpkg in effective_scanlist:
@@ -396,13 +398,9 @@ for xpkg in effective_scanlist:
 		inherited = pkg.inherited
 		live_ebuild = live_eclasses.intersection(inherited)
 
-		if repo_settings.repo_config.eapi_is_banned(eapi):
-			qatracker.add_error(
-				"repo.eapi.banned", "%s: %s" % (ebuild.relative_path, eapi))
-
-		elif repo_settings.repo_config.eapi_is_deprecated(eapi):
-			qatracker.add_error(
-				"repo.eapi.deprecated", "%s: %s" % (ebuild.relative_path, eapi))
+		#######################
+		eapicheck.check(pkg, ebuild)
+		#######################
 
 		for k, v in myaux.items():
 			if not isinstance(v, basestring):


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-17  3:08 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-17  3:08 UTC (permalink / raw
  To: gentoo-commits

commit:     ef4cdee293e2a559ff2e88e578576a642b17edcc
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:50:26 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 17 03:06:48 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ef4cdee2

repoman/main.py: Split DESCRIPTION checks to checks/ebuild/variables/

 .../checks/ebuilds/variables/description.py        | 32 ++++++++++++++++++++++
 pym/repoman/main.py                                | 13 ++++-----
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/description.py b/pym/repoman/checks/ebuilds/variables/description.py
new file mode 100644
index 0000000..a2b1057
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/description.py
@@ -0,0 +1,32 @@
+
+'''description.py
+Perform checks on the DESCRIPTION variable.
+'''
+
+from repoman.qa_data import max_desc_len
+
+
+class DescriptionChecks(object):
+	'''Perform checks on the DESCRIPTION variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		self._checkTooLong(pkg, ebuild)
+
+	def _checkTooLong(self, pkg, ebuild):
+		# 14 is the length of DESCRIPTION=""
+		if len(pkg._metadata['DESCRIPTION']) > max_desc_len:
+			self.qatracker.add_error(
+				'DESCRIPTION.toolong',
+				"%s: DESCRIPTION is %d characters (max %d)" %
+				(ebuild.relative_path, len(
+					pkg._metadata['DESCRIPTION']), max_desc_len))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 6bfd1be..f692b63 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
@@ -68,7 +69,7 @@ from repoman.modules.commit import repochecks
 from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
-	qawarnings, qacats, max_desc_len, missingvars,
+	qawarnings, qacats, missingvars,
 	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
@@ -297,6 +298,7 @@ keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
+descriptioncheck = DescriptionChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -436,12 +438,9 @@ for xpkg in effective_scanlist:
 					myqakey = var + ".virtual"
 					qatracker.add_error(myqakey, ebuild.relative_path)
 
-		# 14 is the length of DESCRIPTION=""
-		if len(myaux['DESCRIPTION']) > max_desc_len:
-			qatracker.add_error(
-				'DESCRIPTION.toolong',
-				"%s: DESCRIPTION is %d characters (max %d)" %
-				(ebuild.relative_path, len(myaux['DESCRIPTION']), max_desc_len))
+		#######################
+		descriptioncheck.check(pkg, ebuild)
+		#######################
 
 		keywords = myaux["KEYWORDS"].split()
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-17  4:51 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-17  4:51 UTC (permalink / raw
  To: gentoo-commits

commit:     fe03af9e968e1a5dc256950214553e49dbf24674
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:23:33 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 17 04:41:27 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fe03af9e

repoman/main.py: Split RESTRICT checks to checks/ebuild/variables/

 pym/repoman/checks/ebuilds/variables/restrict.py | 41 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 25 ++++-----------
 2 files changed, 47 insertions(+), 19 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/restrict.py b/pym/repoman/checks/ebuilds/variables/restrict.py
new file mode 100644
index 0000000..215b792
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/restrict.py
@@ -0,0 +1,41 @@
+
+'''restrict.py
+Perform checks on the RESTRICT variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+from repoman.qa_data import valid_restrict
+
+
+class RestrictChecks(object):
+	'''Perform checks on the RESTRICT variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild):
+		myrestrict = None
+
+		try:
+			myrestrict = portage.dep.use_reduce(
+				pkg._metadata["RESTRICT"], matchall=1, flat=True)
+		except portage.exception.InvalidDependString as e:
+			self. qatracker.add_error(
+				"RESTRICT.syntax",
+				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
+			del e
+
+		if myrestrict:
+			myrestrict = set(myrestrict)
+			mybadrestrict = myrestrict.difference(valid_restrict)
+
+			if mybadrestrict:
+				for mybad in mybadrestrict:
+					self.qatracker.add_error(
+						"RESTRICT.invalid",
+						package + "/" + y_ebuild + ".ebuild: %s" % mybad)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 08d79eb..8497833 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -64,6 +64,7 @@ from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
+from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -71,7 +72,7 @@ from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, missingvars,
-	suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -301,6 +302,7 @@ rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
 licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
+restrictcheck = RestrictChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -623,24 +625,9 @@ for xpkg in effective_scanlist:
 			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
 			#################
 
-		# restrict checks
-		myrestrict = None
-		try:
-			myrestrict = portage.dep.use_reduce(
-				myaux["RESTRICT"], matchall=1, flat=True)
-		except portage.exception.InvalidDependString as e:
-			qatracker.add_error(
-				"RESTRICT.syntax",
-				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
-			del e
-		if myrestrict:
-			myrestrict = set(myrestrict)
-			mybadrestrict = myrestrict.difference(valid_restrict)
-			if mybadrestrict:
-				for mybad in mybadrestrict:
-					qatracker.add_error(
-						"RESTRICT.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % mybad)
+		#################
+		restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
+		#################
 
 		# Syntax Checks
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-17  4:51 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-17  4:51 UTC (permalink / raw
  To: gentoo-commits

commit:     1012eb2535f9afdbcceee0ebfb67d85e4c2035dd
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:50:26 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 17 04:41:27 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1012eb25

repoman/main.py: Split DESCRIPTION checks to checks/ebuild/variables/

 .../checks/ebuilds/variables/description.py        | 32 ++++++++++++++++++++++
 pym/repoman/main.py                                | 13 ++++-----
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/description.py b/pym/repoman/checks/ebuilds/variables/description.py
new file mode 100644
index 0000000..a2b1057
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/description.py
@@ -0,0 +1,32 @@
+
+'''description.py
+Perform checks on the DESCRIPTION variable.
+'''
+
+from repoman.qa_data import max_desc_len
+
+
+class DescriptionChecks(object):
+	'''Perform checks on the DESCRIPTION variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		self._checkTooLong(pkg, ebuild)
+
+	def _checkTooLong(self, pkg, ebuild):
+		# 14 is the length of DESCRIPTION=""
+		if len(pkg._metadata['DESCRIPTION']) > max_desc_len:
+			self.qatracker.add_error(
+				'DESCRIPTION.toolong',
+				"%s: DESCRIPTION is %d characters (max %d)" %
+				(ebuild.relative_path, len(
+					pkg._metadata['DESCRIPTION']), max_desc_len))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 42600cd..7b36852 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
@@ -68,7 +69,7 @@ from repoman.modules.commit import repochecks
 from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
-	qawarnings, qacats, max_desc_len, missingvars,
+	qawarnings, qacats, missingvars,
 	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
@@ -297,6 +298,7 @@ keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
+descriptioncheck = DescriptionChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -436,12 +438,9 @@ for xpkg in effective_scanlist:
 					myqakey = var + ".virtual"
 					qatracker.add_error(myqakey, ebuild.relative_path)
 
-		# 14 is the length of DESCRIPTION=""
-		if len(myaux['DESCRIPTION']) > max_desc_len:
-			qatracker.add_error(
-				'DESCRIPTION.toolong',
-				"%s: DESCRIPTION is %d characters (max %d)" %
-				(ebuild.relative_path, len(myaux['DESCRIPTION']), max_desc_len))
+		#######################
+		descriptioncheck.check(pkg, ebuild)
+		#######################
 
 		keywords = myaux["KEYWORDS"].split()
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-20  2:06 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-20  2:06 UTC (permalink / raw
  To: gentoo-commits

commit:     2fe4697d7fdf7a201582c1c9ac0b01a682b5016b
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:23:33 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 01:54:08 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2fe4697d

repoman/main.py: Split RESTRICT checks to checks/ebuild/variables/

 pym/repoman/checks/ebuilds/variables/restrict.py | 41 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 25 ++++-----------
 2 files changed, 47 insertions(+), 19 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/restrict.py b/pym/repoman/checks/ebuilds/variables/restrict.py
new file mode 100644
index 0000000..215b792
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/restrict.py
@@ -0,0 +1,41 @@
+
+'''restrict.py
+Perform checks on the RESTRICT variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+from repoman.qa_data import valid_restrict
+
+
+class RestrictChecks(object):
+	'''Perform checks on the RESTRICT variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild):
+		myrestrict = None
+
+		try:
+			myrestrict = portage.dep.use_reduce(
+				pkg._metadata["RESTRICT"], matchall=1, flat=True)
+		except portage.exception.InvalidDependString as e:
+			self. qatracker.add_error(
+				"RESTRICT.syntax",
+				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
+			del e
+
+		if myrestrict:
+			myrestrict = set(myrestrict)
+			mybadrestrict = myrestrict.difference(valid_restrict)
+
+			if mybadrestrict:
+				for mybad in mybadrestrict:
+					self.qatracker.add_error(
+						"RESTRICT.invalid",
+						package + "/" + y_ebuild + ".ebuild: %s" % mybad)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 08d79eb..8497833 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -64,6 +64,7 @@ from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.checks.ebuilds.variables.license import LicenseChecks
+from repoman.checks.ebuilds.variables.restrict import RestrictChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -71,7 +72,7 @@ from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, missingvars,
-	suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -301,6 +302,7 @@ rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
 licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
+restrictcheck = RestrictChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -623,24 +625,9 @@ for xpkg in effective_scanlist:
 			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
 			#################
 
-		# restrict checks
-		myrestrict = None
-		try:
-			myrestrict = portage.dep.use_reduce(
-				myaux["RESTRICT"], matchall=1, flat=True)
-		except portage.exception.InvalidDependString as e:
-			qatracker.add_error(
-				"RESTRICT.syntax",
-				"%s: RESTRICT: %s" % (ebuild.relative_path, e))
-			del e
-		if myrestrict:
-			myrestrict = set(myrestrict)
-			mybadrestrict = myrestrict.difference(valid_restrict)
-			if mybadrestrict:
-				for mybad in mybadrestrict:
-					qatracker.add_error(
-						"RESTRICT.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % mybad)
+		#################
+		restrictcheck.check(pkg, xpkg, ebuild, y_ebuild)
+		#################
 
 		# Syntax Checks
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-20  2:06 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-20  2:06 UTC (permalink / raw
  To: gentoo-commits

commit:     0b5e6ce8553a1a754a045d24817496ef2bff41c4
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:40:39 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 01:54:07 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=0b5e6ce8

repoman/main.py: Split EAPI checks to checks/ebuilds/variables/eapi.py

 pym/repoman/checks/ebuilds/variables/__init__.py |  0
 pym/repoman/checks/ebuilds/variables/eapi.py     | 44 ++++++++++++++++++++++++
 pym/repoman/main.py                              | 12 +++----
 3 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/__init__.py b/pym/repoman/checks/ebuilds/variables/__init__.py
new file mode 100644
index 0000000..e69de29

diff --git a/pym/repoman/checks/ebuilds/variables/eapi.py b/pym/repoman/checks/ebuilds/variables/eapi.py
new file mode 100644
index 0000000..2f8b1cb
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/eapi.py
@@ -0,0 +1,44 @@
+
+'''eapi.py
+Perform checks on the EAPI variable.
+'''
+
+
+class EAPIChecks(object):
+	'''Perform checks on the EAPI variable.'''
+
+	def __init__(self, qatracker, repo_settings):
+		'''
+		@param qatracker: QATracker instance
+		@param repo_settings: Repository settings
+		'''
+		self.qatracker = qatracker
+		self.repo_settings = repo_settings
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		eapi = pkg._metadata["EAPI"]
+
+		if not self._checkBanned(ebuild, eapi):
+			self._checkDeprecated(ebuild, eapi)
+
+	def _checkBanned(self, ebuild, eapi):
+		if self.repo_settings.repo_config.eapi_is_banned(eapi):
+			self.qatracker.add_error(
+				"repo.eapi.banned", "%s: %s" % (ebuild.relative_path, eapi))
+
+			return True
+
+		return False
+
+	def _checkDeprecated(self, ebuild, eapi):
+		if self.repo_settings.repo_config.eapi_is_deprecated(eapi):
+			self.qatracker.add_error(
+				"repo.eapi.deprecated", "%s: %s" % (ebuild.relative_path, eapi))
+
+			return True
+
+		return False

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 1e23387..42600cd 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -295,6 +296,7 @@ use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
+eapicheck = EAPIChecks(qatracker, repo_settings)
 ######################
 
 for xpkg in effective_scanlist:
@@ -396,13 +398,9 @@ for xpkg in effective_scanlist:
 		inherited = pkg.inherited
 		live_ebuild = live_eclasses.intersection(inherited)
 
-		if repo_settings.repo_config.eapi_is_banned(eapi):
-			qatracker.add_error(
-				"repo.eapi.banned", "%s: %s" % (ebuild.relative_path, eapi))
-
-		elif repo_settings.repo_config.eapi_is_deprecated(eapi):
-			qatracker.add_error(
-				"repo.eapi.deprecated", "%s: %s" % (ebuild.relative_path, eapi))
+		#######################
+		eapicheck.check(pkg, ebuild)
+		#######################
 
 		for k, v in myaux.items():
 			if not isinstance(v, basestring):


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-20  2:06 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-20  2:06 UTC (permalink / raw
  To: gentoo-commits

commit:     f4714cbbb90bd40fcbcec933529a3b3936611af9
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:09:43 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 01:54:08 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f4714cbb

repoman/main.py: Split LICENSE checks to checks/ebuild/variables/

 pym/repoman/checks/ebuilds/variables/license.py | 47 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 21 +++--------
 2 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/license.py b/pym/repoman/checks/ebuilds/variables/license.py
new file mode 100644
index 0000000..bdc859c
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/license.py
@@ -0,0 +1,47 @@
+
+'''description.py
+Perform checks on the LICENSE variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+
+class LicenseChecks(object):
+	'''Perform checks on the LICENSE variable.'''
+
+	def __init__(self, qatracker, liclist, liclist_deprecated):
+		'''
+		@param qatracker: QATracker instance
+		@param liclist: List of licenses.
+		@param liclist: List of deprecated licenses.
+		'''
+		self.qatracker = qatracker
+		self.liclist = liclist
+		self.liclist_deprecated = liclist_deprecated
+
+	def check(
+		self, pkg, package, ebuild, y_ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param package: Package in which we check (string).
+		@param ebuild: Ebuild which we check (object).
+		@param y_ebuild: Ebuild which we check (string).
+		'''
+
+		# Parse the LICENSE variable, remove USE conditions and flatten it.
+		licenses = portage.dep.use_reduce(
+			pkg._metadata["LICENSE"], matchall=1, flat=True)
+
+		# Check each entry to ensure that it exists in ${PORTDIR}/licenses/.
+		for lic in licenses:
+			# Need to check for "||" manually as no portage
+			# function will remove it without removing values.
+			if lic not in self.liclist and lic != "||":
+				self.qatracker.add_error(
+					"LICENSE.invalid",
+					package + "/" + y_ebuild + ".ebuild: %s" % lic)
+			elif lic in self.liclist_deprecated:
+				self.qatracker.add_error(
+					"LICENSE.deprecated",
+					"%s: %s" % (ebuild.relative_path, lic))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 7b36852..08d79eb 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -63,6 +63,7 @@ from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
+from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -299,6 +300,7 @@ liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
+licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
 ######################
 
 for xpkg in effective_scanlist:
@@ -617,22 +619,9 @@ for xpkg in effective_scanlist:
 
 		# license checks
 		if not badlicsyntax:
-			# Parse the LICENSE variable, remove USE conditions and
-			# flatten it.
-			licenses = portage.dep.use_reduce(myaux["LICENSE"], matchall=1, flat=True)
-			# Check each entry to ensure that it exists in PORTDIR's
-			# license directory.
-			for lic in licenses:
-				# Need to check for "||" manually as no portage
-				# function will remove it without removing values.
-				if lic not in liclist and lic != "||":
-					qatracker.add_error(
-						"LICENSE.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % lic)
-				elif lic in liclist_deprecated:
-					qatracker.add_error(
-						"LICENSE.deprecated",
-						"%s: %s" % (ebuild.relative_path, lic))
+			#################
+			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
+			#################
 
 		# restrict checks
 		myrestrict = None


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-20  2:06 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-20  2:06 UTC (permalink / raw
  To: gentoo-commits

commit:     ea818918314a1480b380ad8905693290d8c69385
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:50:26 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Sep 20 01:54:07 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ea818918

repoman/main.py: Split DESCRIPTION checks to checks/ebuild/variables/

 .../checks/ebuilds/variables/description.py        | 32 ++++++++++++++++++++++
 pym/repoman/main.py                                | 13 ++++-----
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/description.py b/pym/repoman/checks/ebuilds/variables/description.py
new file mode 100644
index 0000000..a2b1057
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/description.py
@@ -0,0 +1,32 @@
+
+'''description.py
+Perform checks on the DESCRIPTION variable.
+'''
+
+from repoman.qa_data import max_desc_len
+
+
+class DescriptionChecks(object):
+	'''Perform checks on the DESCRIPTION variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		self._checkTooLong(pkg, ebuild)
+
+	def _checkTooLong(self, pkg, ebuild):
+		# 14 is the length of DESCRIPTION=""
+		if len(pkg._metadata['DESCRIPTION']) > max_desc_len:
+			self.qatracker.add_error(
+				'DESCRIPTION.toolong',
+				"%s: DESCRIPTION is %d characters (max %d)" %
+				(ebuild.relative_path, len(
+					pkg._metadata['DESCRIPTION']), max_desc_len))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 42600cd..7b36852 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
@@ -68,7 +69,7 @@ from repoman.modules.commit import repochecks
 from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
-	qawarnings, qacats, max_desc_len, missingvars,
+	qawarnings, qacats, missingvars,
 	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
@@ -297,6 +298,7 @@ keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
+descriptioncheck = DescriptionChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -436,12 +438,9 @@ for xpkg in effective_scanlist:
 					myqakey = var + ".virtual"
 					qatracker.add_error(myqakey, ebuild.relative_path)
 
-		# 14 is the length of DESCRIPTION=""
-		if len(myaux['DESCRIPTION']) > max_desc_len:
-			qatracker.add_error(
-				'DESCRIPTION.toolong',
-				"%s: DESCRIPTION is %d characters (max %d)" %
-				(ebuild.relative_path, len(myaux['DESCRIPTION']), max_desc_len))
+		#######################
+		descriptioncheck.check(pkg, ebuild)
+		#######################
 
 		keywords = myaux["KEYWORDS"].split()
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/
@ 2015-09-21 23:47 Brian Dolbec
  0 siblings, 0 replies; 28+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:47 UTC (permalink / raw
  To: gentoo-commits

commit:     f662a734a28a9c6a13233693fd08498d371054e0
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 14:50:26 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:44 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f662a734

repoman/main.py: Split DESCRIPTION checks to checks/ebuild/variables/

 .../checks/ebuilds/variables/description.py        | 32 ++++++++++++++++++++++
 pym/repoman/main.py                                | 13 ++++-----
 2 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/description.py b/pym/repoman/checks/ebuilds/variables/description.py
new file mode 100644
index 0000000..a2b1057
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/description.py
@@ -0,0 +1,32 @@
+
+'''description.py
+Perform checks on the DESCRIPTION variable.
+'''
+
+from repoman.qa_data import max_desc_len
+
+
+class DescriptionChecks(object):
+	'''Perform checks on the DESCRIPTION variable.'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param ebuild: Ebuild which we check (object).
+		'''
+		self._checkTooLong(pkg, ebuild)
+
+	def _checkTooLong(self, pkg, ebuild):
+		# 14 is the length of DESCRIPTION=""
+		if len(pkg._metadata['DESCRIPTION']) > max_desc_len:
+			self.qatracker.add_error(
+				'DESCRIPTION.toolong',
+				"%s: DESCRIPTION is %d characters (max %d)" %
+				(ebuild.relative_path, len(
+					pkg._metadata['DESCRIPTION']), max_desc_len))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 42600cd..7b36852 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -61,6 +61,7 @@ from repoman.check_missingslot import check_missingslot
 from repoman.checks.ebuilds.misc import bad_split_check, pkg_invalid
 from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
+from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
@@ -68,7 +69,7 @@ from repoman.modules.commit import repochecks
 from repoman.profile import check_profiles, dev_keywords, setup_profile
 from repoman.qa_data import (
 	format_qa_output, format_qa_output_column, qahelp,
-	qawarnings, qacats, max_desc_len, missingvars,
+	qawarnings, qacats, missingvars,
 	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
@@ -297,6 +298,7 @@ keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
+descriptioncheck = DescriptionChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -436,12 +438,9 @@ for xpkg in effective_scanlist:
 					myqakey = var + ".virtual"
 					qatracker.add_error(myqakey, ebuild.relative_path)
 
-		# 14 is the length of DESCRIPTION=""
-		if len(myaux['DESCRIPTION']) > max_desc_len:
-			qatracker.add_error(
-				'DESCRIPTION.toolong',
-				"%s: DESCRIPTION is %d characters (max %d)" %
-				(ebuild.relative_path, len(myaux['DESCRIPTION']), max_desc_len))
+		#######################
+		descriptioncheck.check(pkg, ebuild)
+		#######################
 
 		keywords = myaux["KEYWORDS"].split()
 


^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/checks/ebuilds/variables/, pym/repoman/
@ 2015-09-21 23:51 Brian Dolbec
  2015-09-21 23:47 ` [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/ Brian Dolbec
  0 siblings, 1 reply; 28+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
  To: gentoo-commits

commit:     f1407272871994cd83a18398b566566a61d4f9d0
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  6 15:09:43 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:44 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f1407272

repoman/main.py: Split LICENSE checks to checks/ebuild/variables/

 pym/repoman/checks/ebuilds/variables/license.py | 47 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 21 +++--------
 2 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/variables/license.py b/pym/repoman/checks/ebuilds/variables/license.py
new file mode 100644
index 0000000..bdc859c
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/variables/license.py
@@ -0,0 +1,47 @@
+
+'''description.py
+Perform checks on the LICENSE variable.
+'''
+
+# import our initialized portage instance
+from repoman._portage import portage
+
+
+class LicenseChecks(object):
+	'''Perform checks on the LICENSE variable.'''
+
+	def __init__(self, qatracker, liclist, liclist_deprecated):
+		'''
+		@param qatracker: QATracker instance
+		@param liclist: List of licenses.
+		@param liclist: List of deprecated licenses.
+		'''
+		self.qatracker = qatracker
+		self.liclist = liclist
+		self.liclist_deprecated = liclist_deprecated
+
+	def check(
+		self, pkg, package, ebuild, y_ebuild):
+		'''
+		@param pkg: Package in which we check (object).
+		@param package: Package in which we check (string).
+		@param ebuild: Ebuild which we check (object).
+		@param y_ebuild: Ebuild which we check (string).
+		'''
+
+		# Parse the LICENSE variable, remove USE conditions and flatten it.
+		licenses = portage.dep.use_reduce(
+			pkg._metadata["LICENSE"], matchall=1, flat=True)
+
+		# Check each entry to ensure that it exists in ${PORTDIR}/licenses/.
+		for lic in licenses:
+			# Need to check for "||" manually as no portage
+			# function will remove it without removing values.
+			if lic not in self.liclist and lic != "||":
+				self.qatracker.add_error(
+					"LICENSE.invalid",
+					package + "/" + y_ebuild + ".ebuild: %s" % lic)
+			elif lic in self.liclist_deprecated:
+				self.qatracker.add_error(
+					"LICENSE.deprecated",
+					"%s: %s" % (ebuild.relative_path, lic))

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 7b36852..08d79eb 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -63,6 +63,7 @@ from repoman.checks.ebuilds.pkgmetadata import PkgMetadata
 from repoman.checks.ebuilds.use_flags import USEFlagChecks
 from repoman.checks.ebuilds.variables.description import DescriptionChecks
 from repoman.checks.ebuilds.variables.eapi import EAPIChecks
+from repoman.checks.ebuilds.variables.license import LicenseChecks
 from repoman.ebuild import Ebuild
 from repoman.errors import err
 from repoman.modules.commit import repochecks
@@ -299,6 +300,7 @@ liveeclasscheck = LiveEclassChecks(qatracker)
 rubyeclasscheck = RubyEclassChecks(qatracker)
 eapicheck = EAPIChecks(qatracker, repo_settings)
 descriptioncheck = DescriptionChecks(qatracker)
+licensecheck = LicenseChecks(qatracker, liclist, liclist_deprecated)
 ######################
 
 for xpkg in effective_scanlist:
@@ -617,22 +619,9 @@ for xpkg in effective_scanlist:
 
 		# license checks
 		if not badlicsyntax:
-			# Parse the LICENSE variable, remove USE conditions and
-			# flatten it.
-			licenses = portage.dep.use_reduce(myaux["LICENSE"], matchall=1, flat=True)
-			# Check each entry to ensure that it exists in PORTDIR's
-			# license directory.
-			for lic in licenses:
-				# Need to check for "||" manually as no portage
-				# function will remove it without removing values.
-				if lic not in liclist and lic != "||":
-					qatracker.add_error(
-						"LICENSE.invalid",
-						xpkg + "/" + y_ebuild + ".ebuild: %s" % lic)
-				elif lic in liclist_deprecated:
-					qatracker.add_error(
-						"LICENSE.deprecated",
-						"%s: %s" % (ebuild.relative_path, lic))
+			#################
+			licensecheck.check(pkg, xpkg, ebuild, y_ebuild)
+			#################
 
 		# restrict checks
 		myrestrict = None


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

end of thread, other threads:[~2015-09-21 23:48 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-06 14:41 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/ Tom Wijsman
  -- strict thread matches above, loose matches on Subject: below --
2014-06-06 14:51 Tom Wijsman
2014-06-06 15:10 Tom Wijsman
2014-06-06 15:24 Tom Wijsman
2014-10-01 23:02 Brian Dolbec
2014-10-01 23:02 Brian Dolbec
2014-10-01 23:46 Brian Dolbec
2014-11-17  0:55 Brian Dolbec
2015-08-10 13:44 Brian Dolbec
2015-08-10 13:44 Brian Dolbec
2015-08-10 13:44 Brian Dolbec
2015-08-10 14:45 Michał Górny
2015-08-10 14:45 Michał Górny
2015-08-11 23:54 Brian Dolbec
2015-08-11 23:54 Brian Dolbec
2015-09-05 21:27 Brian Dolbec
2015-09-05 21:27 Brian Dolbec
2015-09-05 21:27 Brian Dolbec
2015-09-05 21:48 Brian Dolbec
2015-09-17  3:08 Brian Dolbec
2015-09-17  4:51 Brian Dolbec
2015-09-17  4:51 Brian Dolbec
2015-09-20  2:06 Brian Dolbec
2015-09-20  2:06 Brian Dolbec
2015-09-20  2:06 Brian Dolbec
2015-09-20  2:06 Brian Dolbec
2015-09-21 23:47 Brian Dolbec
2015-09-21 23:51 [gentoo-commits] proj/portage:master commit in: pym/repoman/checks/ebuilds/variables/, pym/repoman/ Brian Dolbec
2015-09-21 23:47 ` [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/checks/ebuilds/variables/ Brian Dolbec

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