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/eclasses/
@ 2015-08-11 23:54 Brian Dolbec
  0 siblings, 0 replies; 15+ messages in thread
From: Brian Dolbec @ 2015-08-11 23:54 UTC (permalink / raw
  To: gentoo-commits

commit:     76fcb314e1f5403c8f813e974cf6da7514da6497
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:40:35 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Aug 11 23:52:54 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=76fcb314

repoman/main.py: Split "Live" checks to checks/ebuilds/eclass/live.py

 pym/repoman/checks/ebuilds/eclasses/live.py | 39 +++++++++++++++++++++++++
 pym/repoman/main.py                         | 45 ++++++++++++-----------------
 2 files changed, 57 insertions(+), 27 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/live.py b/pym/repoman/checks/ebuilds/eclasses/live.py
new file mode 100644
index 0000000..20c573e
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/live.py
@@ -0,0 +1,39 @@
+
+'''live.py
+Performs Live eclass checks
+'''
+
+from repoman.repos import has_global_mask
+
+
+class LiveEclassChecks(object):
+	'''Performs checks for the usage of Live eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild, keywords, global_pmaskdict):
+		'''Ebuilds that inherit a "Live" eclass (darcs, subversion, git, cvs,
+		etc..) should not be allowed to be marked stable
+
+		@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).
+		@param keywords: The keywords of the ebuild.
+		@param global_pmaskdict: A global dictionary of all the masks.
+		'''
+		is_stable = lambda kw: not kw.startswith("~") and not kw.startswith("-")
+		bad_stable_keywords = list(filter(is_stable, keywords))
+
+		if bad_stable_keywords:
+			self.qatracker.add_error(
+				"LIVEVCS.stable", "%s/%s.ebuild with stable keywords:%s " % (
+					package, y_ebuild, bad_stable_keywords))
+
+		good_keywords_exist = len(bad_stable_keywords) < len(keywords)
+		if good_keywords_exist and not has_global_mask(pkg, global_pmaskdict):
+			self.qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 1d2a3fb..f8a4993 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -50,6 +50,7 @@ from portage.package.ebuild.digestgen import digestgen
 from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
+from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -63,16 +64,17 @@ from repoman.ebuild import Ebuild
 from repoman.errors import err
 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,
+from repoman.qa_data import (
+	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, max_desc_len, missingvars,
 	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
-from repoman.repos import has_global_mask, RepoSettings, repo_metadata
+from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
 from repoman._subprocess import repoman_popen, repoman_getstatusoutput
 from repoman import utilities
-from repoman.vcs.vcs import (git_supports_gpg_sign, vcs_files_to_cps,
-	VCSSettings)
+from repoman.vcs.vcs import (
+	git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
 from repoman.vcs.vcsstatus import VCSStatus
 
 
@@ -274,18 +276,21 @@ if options.if_modified == "y":
 		chain(changed.changed, changed.new, changed.removed),
 		repolevel, reposplit, categories))
 
-#######  initialize our checks classes here before the big xpkg loop
+######################
+# initialize our checks classes here before the big xpkg loop
 manifester = Manifests(options, qatracker, repoman_settings)
 is_ebuild = IsEbuild(repoman_settings, repo_settings, portdb, qatracker)
-filescheck = FileChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+filescheck = FileChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 status_check = VCSStatus(vcs_settings, qatracker)
-fetchcheck = FetchChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+fetchcheck = FetchChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 pkgmeta = PkgMetadata(options, qatracker, repoman_settings)
 thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
+liveeclasscheck = LiveEclassChecks(qatracker)
+######################
 
 for xpkg in effective_scanlist:
 	# ebuilds and digests added to cvs respectively.
@@ -454,25 +459,11 @@ for xpkg in effective_scanlist:
 				qatracker.add_error("KEYWORDS.stupid",
 					xpkg + "/" + y_ebuild + ".ebuild")
 
-		"""
-		Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
-		not be allowed to be marked stable
-		"""
 		if live_ebuild and repo_settings.repo_config.name == "gentoo":
-			bad_stable_keywords = []
-			for keyword in keywords:
-				if not keyword.startswith("~") and \
-					not keyword.startswith("-"):
-					bad_stable_keywords.append(keyword)
-				del keyword
-			if bad_stable_keywords:
-				qatracker.add_error("LIVEVCS.stable",
-					"%s/%s.ebuild with stable keywords:%s " %
-					(xpkg, y_ebuild, bad_stable_keywords))
-			del bad_stable_keywords
-
-			if keywords and not has_global_mask(pkg, global_pmaskdict):
-				qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
+			#######################
+			liveeclasscheck.check(
+				pkg, xpkg, ebuild, y_ebuild, keywords, global_pmaskdict)
+			#######################
 
 		if options.ignore_arches:
 			arches = [[


^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/repoman/checks/ebuilds/eclasses/, 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/eclasses/ Brian Dolbec
  0 siblings, 1 reply; 15+ messages in thread
From: Brian Dolbec @ 2015-09-21 23:51 UTC (permalink / raw
  To: gentoo-commits

commit:     c7708b5906e9036464a63f7c87eaf56282fbd251
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:58:31 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Sep 21 23:42:43 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c7708b59

repoman/main.py: Split Ruby checks to checks/ebuild/eclass/ruby.py

 pym/repoman/checks/ebuilds/eclasses/__init__.py |  0
 pym/repoman/checks/ebuilds/eclasses/ruby.py     | 32 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 18 ++++----------
 3 files changed, 37 insertions(+), 13 deletions(-)

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

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/checks/ebuilds/eclasses/ruby.py
new file mode 100644
index 0000000..abfb166
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/ruby.py
@@ -0,0 +1,32 @@
+
+'''live.py
+Performs Ruby eclass checks
+'''
+
+from repoman.qa_data import ruby_deprecated
+
+
+class RubyEclassChecks(object):
+	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
+
+	def check(self, pkg, ebuild):
+		is_inherited = lambda eclass: eclass in pkg.inherited
+		is_old_ruby_eclass_inherited = filter(
+			is_inherited, self.old_ruby_eclasses)
+
+		if is_old_ruby_eclass_inherited:
+			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+
+			if ruby_intersection:
+				for myruby in ruby_intersection:
+					self.qatracker.add_error(
+						"IUSE.rubydeprecated",
+						(ebuild.relative_path + ": Deprecated ruby target: %s")
+						% myruby)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 39c8e1a..4ded687 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -51,6 +51,7 @@ from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
 from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -67,7 +68,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, max_desc_len, missingvars,
-	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -290,6 +291,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
+rubyeclasscheck = RubyEclassChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -615,18 +617,8 @@ for xpkg in effective_scanlist:
 		ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
 		used_useflags = used_useflags.union(ebuild_used_useflags)
 		#################
-
-		# Check for outdated RUBY targets
-		old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
-		is_old_ruby_eclass_inherited = filter(
-			lambda e: e in inherited, old_ruby_eclasses)
-		if is_old_ruby_eclass_inherited:
-			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
-			if ruby_intersection:
-				for myruby in ruby_intersection:
-					qatracker.add_error("IUSE.rubydeprecated",
-						(ebuild.relative_path + ": Deprecated ruby target: %s")
-						% myruby)
+		rubyeclasscheck.check(pkg, ebuild)
+		#################
 
 		# license checks
 		if not badlicsyntax:


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

commit:     7049f1565fe1de96cf8b82a158116c3c2e509c10
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:58:31 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 17 04:41:26 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=7049f156

repoman/main.py: Split Ruby checks to checks/ebuild/eclass/ruby.py

 pym/repoman/checks/ebuilds/eclasses/__init__.py |  0
 pym/repoman/checks/ebuilds/eclasses/ruby.py     | 32 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 18 ++++----------
 3 files changed, 37 insertions(+), 13 deletions(-)

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

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/checks/ebuilds/eclasses/ruby.py
new file mode 100644
index 0000000..abfb166
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/ruby.py
@@ -0,0 +1,32 @@
+
+'''live.py
+Performs Ruby eclass checks
+'''
+
+from repoman.qa_data import ruby_deprecated
+
+
+class RubyEclassChecks(object):
+	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
+
+	def check(self, pkg, ebuild):
+		is_inherited = lambda eclass: eclass in pkg.inherited
+		is_old_ruby_eclass_inherited = filter(
+			is_inherited, self.old_ruby_eclasses)
+
+		if is_old_ruby_eclass_inherited:
+			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+
+			if ruby_intersection:
+				for myruby in ruby_intersection:
+					self.qatracker.add_error(
+						"IUSE.rubydeprecated",
+						(ebuild.relative_path + ": Deprecated ruby target: %s")
+						% myruby)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 39c8e1a..4ded687 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -51,6 +51,7 @@ from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
 from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -67,7 +68,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, max_desc_len, missingvars,
-	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -290,6 +291,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
+rubyeclasscheck = RubyEclassChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -615,18 +617,8 @@ for xpkg in effective_scanlist:
 		ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
 		used_useflags = used_useflags.union(ebuild_used_useflags)
 		#################
-
-		# Check for outdated RUBY targets
-		old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
-		is_old_ruby_eclass_inherited = filter(
-			lambda e: e in inherited, old_ruby_eclasses)
-		if is_old_ruby_eclass_inherited:
-			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
-			if ruby_intersection:
-				for myruby in ruby_intersection:
-					qatracker.add_error("IUSE.rubydeprecated",
-						(ebuild.relative_path + ": Deprecated ruby target: %s")
-						% myruby)
+		rubyeclasscheck.check(pkg, ebuild)
+		#################
 
 		# license checks
 		if not badlicsyntax:


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

commit:     fbb8baecda4d80f4f1aa14e2e4479702135dfab0
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:40:35 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 17 03:06:47 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=fbb8baec

repoman/main.py: Split "Live" checks to checks/ebuilds/eclass/live.py

 pym/repoman/checks/ebuilds/eclasses/live.py | 39 +++++++++++++++++++++++++
 pym/repoman/main.py                         | 45 ++++++++++++-----------------
 2 files changed, 57 insertions(+), 27 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/live.py b/pym/repoman/checks/ebuilds/eclasses/live.py
new file mode 100644
index 0000000..20c573e
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/live.py
@@ -0,0 +1,39 @@
+
+'''live.py
+Performs Live eclass checks
+'''
+
+from repoman.repos import has_global_mask
+
+
+class LiveEclassChecks(object):
+	'''Performs checks for the usage of Live eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild, keywords, global_pmaskdict):
+		'''Ebuilds that inherit a "Live" eclass (darcs, subversion, git, cvs,
+		etc..) should not be allowed to be marked stable
+
+		@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).
+		@param keywords: The keywords of the ebuild.
+		@param global_pmaskdict: A global dictionary of all the masks.
+		'''
+		is_stable = lambda kw: not kw.startswith("~") and not kw.startswith("-")
+		bad_stable_keywords = list(filter(is_stable, keywords))
+
+		if bad_stable_keywords:
+			self.qatracker.add_error(
+				"LIVEVCS.stable", "%s/%s.ebuild with stable keywords:%s " % (
+					package, y_ebuild, bad_stable_keywords))
+
+		good_keywords_exist = len(bad_stable_keywords) < len(keywords)
+		if good_keywords_exist and not has_global_mask(pkg, global_pmaskdict):
+			self.qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 6e9dc22..305e0b1 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -50,6 +50,7 @@ from portage.package.ebuild.digestgen import digestgen
 from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
+from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -63,16 +64,17 @@ from repoman.ebuild import Ebuild
 from repoman.errors import err
 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,
+from repoman.qa_data import (
+	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, max_desc_len, missingvars,
 	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
-from repoman.repos import has_global_mask, RepoSettings, repo_metadata
+from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
 from repoman._subprocess import repoman_popen, repoman_getstatusoutput
 from repoman import utilities
-from repoman.vcs.vcs import (git_supports_gpg_sign, vcs_files_to_cps,
-	VCSSettings)
+from repoman.vcs.vcs import (
+	git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
 from repoman.vcs.vcsstatus import VCSStatus
 
 
@@ -274,18 +276,21 @@ if options.if_modified == "y":
 		chain(changed.changed, changed.new, changed.removed),
 		repolevel, reposplit, categories))
 
-#######  initialize our checks classes here before the big xpkg loop
+######################
+# initialize our checks classes here before the big xpkg loop
 manifester = Manifests(options, qatracker, repoman_settings)
 is_ebuild = IsEbuild(repoman_settings, repo_settings, portdb, qatracker)
-filescheck = FileChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+filescheck = FileChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 status_check = VCSStatus(vcs_settings, qatracker)
-fetchcheck = FetchChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+fetchcheck = FetchChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 pkgmeta = PkgMetadata(options, qatracker, repoman_settings)
 thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
+liveeclasscheck = LiveEclassChecks(qatracker)
+######################
 
 for xpkg in effective_scanlist:
 	# ebuilds and digests added to cvs respectively.
@@ -454,25 +459,11 @@ for xpkg in effective_scanlist:
 				qatracker.add_error("KEYWORDS.stupid",
 					xpkg + "/" + y_ebuild + ".ebuild")
 
-		"""
-		Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
-		not be allowed to be marked stable
-		"""
 		if live_ebuild and repo_settings.repo_config.name == "gentoo":
-			bad_stable_keywords = []
-			for keyword in keywords:
-				if not keyword.startswith("~") and \
-					not keyword.startswith("-"):
-					bad_stable_keywords.append(keyword)
-				del keyword
-			if bad_stable_keywords:
-				qatracker.add_error("LIVEVCS.stable",
-					"%s/%s.ebuild with stable keywords:%s " %
-					(xpkg, y_ebuild, bad_stable_keywords))
-			del bad_stable_keywords
-
-			if keywords and not has_global_mask(pkg, global_pmaskdict):
-				qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
+			#######################
+			liveeclasscheck.check(
+				pkg, xpkg, ebuild, y_ebuild, keywords, global_pmaskdict)
+			#######################
 
 		if options.ignore_arches:
 			arches = [[


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

commit:     6811087cc9520c0d5b7e50350a7c9302ba9c539d
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:58:31 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep  5 21:47:37 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6811087c

repoman/main.py: Split Ruby checks to checks/ebuild/eclass/ruby.py

 pym/repoman/checks/ebuilds/eclasses/__init__.py |  0
 pym/repoman/checks/ebuilds/eclasses/ruby.py     | 32 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 18 ++++----------
 3 files changed, 37 insertions(+), 13 deletions(-)

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

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/checks/ebuilds/eclasses/ruby.py
new file mode 100644
index 0000000..abfb166
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/ruby.py
@@ -0,0 +1,32 @@
+
+'''live.py
+Performs Ruby eclass checks
+'''
+
+from repoman.qa_data import ruby_deprecated
+
+
+class RubyEclassChecks(object):
+	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
+
+	def check(self, pkg, ebuild):
+		is_inherited = lambda eclass: eclass in pkg.inherited
+		is_old_ruby_eclass_inherited = filter(
+			is_inherited, self.old_ruby_eclasses)
+
+		if is_old_ruby_eclass_inherited:
+			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+
+			if ruby_intersection:
+				for myruby in ruby_intersection:
+					self.qatracker.add_error(
+						"IUSE.rubydeprecated",
+						(ebuild.relative_path + ": Deprecated ruby target: %s")
+						% myruby)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 305e0b1..7795f2f 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -51,6 +51,7 @@ from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
 from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -67,7 +68,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, max_desc_len, missingvars,
-	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -290,6 +291,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
+rubyeclasscheck = RubyEclassChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -615,18 +617,8 @@ for xpkg in effective_scanlist:
 		ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
 		used_useflags = used_useflags.union(ebuild_used_useflags)
 		#################
-
-		# Check for outdated RUBY targets
-		old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
-		is_old_ruby_eclass_inherited = filter(
-			lambda e: e in inherited, old_ruby_eclasses)
-		if is_old_ruby_eclass_inherited:
-			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
-			if ruby_intersection:
-				for myruby in ruby_intersection:
-					qatracker.add_error("IUSE.rubydeprecated",
-						(ebuild.relative_path + ": Deprecated ruby target: %s")
-						% myruby)
+		rubyeclasscheck.check(pkg, ebuild)
+		#################
 
 		# license checks
 		if not badlicsyntax:


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

commit:     f58cea2bd71b571e0ff49f6284d5d76fdbed446f
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:40:35 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep  5 21:47:37 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f58cea2b

repoman/main.py: Split "Live" checks to checks/ebuilds/eclass/live.py

 pym/repoman/checks/ebuilds/eclasses/live.py | 39 +++++++++++++++++++++++++
 pym/repoman/main.py                         | 45 ++++++++++++-----------------
 2 files changed, 57 insertions(+), 27 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/live.py b/pym/repoman/checks/ebuilds/eclasses/live.py
new file mode 100644
index 0000000..20c573e
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/live.py
@@ -0,0 +1,39 @@
+
+'''live.py
+Performs Live eclass checks
+'''
+
+from repoman.repos import has_global_mask
+
+
+class LiveEclassChecks(object):
+	'''Performs checks for the usage of Live eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild, keywords, global_pmaskdict):
+		'''Ebuilds that inherit a "Live" eclass (darcs, subversion, git, cvs,
+		etc..) should not be allowed to be marked stable
+
+		@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).
+		@param keywords: The keywords of the ebuild.
+		@param global_pmaskdict: A global dictionary of all the masks.
+		'''
+		is_stable = lambda kw: not kw.startswith("~") and not kw.startswith("-")
+		bad_stable_keywords = list(filter(is_stable, keywords))
+
+		if bad_stable_keywords:
+			self.qatracker.add_error(
+				"LIVEVCS.stable", "%s/%s.ebuild with stable keywords:%s " % (
+					package, y_ebuild, bad_stable_keywords))
+
+		good_keywords_exist = len(bad_stable_keywords) < len(keywords)
+		if good_keywords_exist and not has_global_mask(pkg, global_pmaskdict):
+			self.qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 6e9dc22..305e0b1 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -50,6 +50,7 @@ from portage.package.ebuild.digestgen import digestgen
 from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
+from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -63,16 +64,17 @@ from repoman.ebuild import Ebuild
 from repoman.errors import err
 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,
+from repoman.qa_data import (
+	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, max_desc_len, missingvars,
 	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
-from repoman.repos import has_global_mask, RepoSettings, repo_metadata
+from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
 from repoman._subprocess import repoman_popen, repoman_getstatusoutput
 from repoman import utilities
-from repoman.vcs.vcs import (git_supports_gpg_sign, vcs_files_to_cps,
-	VCSSettings)
+from repoman.vcs.vcs import (
+	git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
 from repoman.vcs.vcsstatus import VCSStatus
 
 
@@ -274,18 +276,21 @@ if options.if_modified == "y":
 		chain(changed.changed, changed.new, changed.removed),
 		repolevel, reposplit, categories))
 
-#######  initialize our checks classes here before the big xpkg loop
+######################
+# initialize our checks classes here before the big xpkg loop
 manifester = Manifests(options, qatracker, repoman_settings)
 is_ebuild = IsEbuild(repoman_settings, repo_settings, portdb, qatracker)
-filescheck = FileChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+filescheck = FileChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 status_check = VCSStatus(vcs_settings, qatracker)
-fetchcheck = FetchChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+fetchcheck = FetchChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 pkgmeta = PkgMetadata(options, qatracker, repoman_settings)
 thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
+liveeclasscheck = LiveEclassChecks(qatracker)
+######################
 
 for xpkg in effective_scanlist:
 	# ebuilds and digests added to cvs respectively.
@@ -454,25 +459,11 @@ for xpkg in effective_scanlist:
 				qatracker.add_error("KEYWORDS.stupid",
 					xpkg + "/" + y_ebuild + ".ebuild")
 
-		"""
-		Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
-		not be allowed to be marked stable
-		"""
 		if live_ebuild and repo_settings.repo_config.name == "gentoo":
-			bad_stable_keywords = []
-			for keyword in keywords:
-				if not keyword.startswith("~") and \
-					not keyword.startswith("-"):
-					bad_stable_keywords.append(keyword)
-				del keyword
-			if bad_stable_keywords:
-				qatracker.add_error("LIVEVCS.stable",
-					"%s/%s.ebuild with stable keywords:%s " %
-					(xpkg, y_ebuild, bad_stable_keywords))
-			del bad_stable_keywords
-
-			if keywords and not has_global_mask(pkg, global_pmaskdict):
-				qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
+			#######################
+			liveeclasscheck.check(
+				pkg, xpkg, ebuild, y_ebuild, keywords, global_pmaskdict)
+			#######################
 
 		if options.ignore_arches:
 			arches = [[


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

commit:     aa9ced164ca32e47e590337aee3a2a93453236eb
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:58:31 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sat Sep  5 21:26:59 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=aa9ced16

repoman/main.py: Split Ruby checks to checks/ebuild/eclass/ruby.py

 pym/repoman/checks/ebuilds/eclasses/__init__.py |  0
 pym/repoman/checks/ebuilds/eclasses/ruby.py     | 32 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 18 ++++----------
 3 files changed, 37 insertions(+), 13 deletions(-)

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

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/checks/ebuilds/eclasses/ruby.py
new file mode 100644
index 0000000..abfb166
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/ruby.py
@@ -0,0 +1,32 @@
+
+'''live.py
+Performs Ruby eclass checks
+'''
+
+from repoman.qa_data import ruby_deprecated
+
+
+class RubyEclassChecks(object):
+	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
+
+	def check(self, pkg, ebuild):
+		is_inherited = lambda eclass: eclass in pkg.inherited
+		is_old_ruby_eclass_inherited = filter(
+			is_inherited, self.old_ruby_eclasses)
+
+		if is_old_ruby_eclass_inherited:
+			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+
+			if ruby_intersection:
+				for myruby in ruby_intersection:
+					self.qatracker.add_error(
+						"IUSE.rubydeprecated",
+						(ebuild.relative_path + ": Deprecated ruby target: %s")
+						% myruby)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index f8a4993..bcd2174 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -51,6 +51,7 @@ from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
 from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -67,7 +68,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, max_desc_len, missingvars,
-	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -290,6 +291,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
+rubyeclasscheck = RubyEclassChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -615,18 +617,8 @@ for xpkg in effective_scanlist:
 		ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
 		used_useflags = used_useflags.union(ebuild_used_useflags)
 		#################
-
-		# Check for outdated RUBY targets
-		old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
-		is_old_ruby_eclass_inherited = filter(
-			lambda e: e in inherited, old_ruby_eclasses)
-		if is_old_ruby_eclass_inherited:
-			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
-			if ruby_intersection:
-				for myruby in ruby_intersection:
-					qatracker.add_error("IUSE.rubydeprecated",
-						(ebuild.relative_path + ": Deprecated ruby target: %s")
-						% myruby)
+		rubyeclasscheck.check(pkg, ebuild)
+		#################
 
 		# license checks
 		if not badlicsyntax:


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

commit:     81a1ca3d16b54f13e5b7fd5b20c09c3b22d05279
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:58:31 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Aug 11 23:52:55 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=81a1ca3d

repoman/main.py: Split Ruby checks to checks/ebuild/eclass/ruby.py

 pym/repoman/checks/ebuilds/eclasses/__init__.py |  0
 pym/repoman/checks/ebuilds/eclasses/ruby.py     | 32 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 18 ++++----------
 3 files changed, 37 insertions(+), 13 deletions(-)

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

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/checks/ebuilds/eclasses/ruby.py
new file mode 100644
index 0000000..abfb166
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/ruby.py
@@ -0,0 +1,32 @@
+
+'''live.py
+Performs Ruby eclass checks
+'''
+
+from repoman.qa_data import ruby_deprecated
+
+
+class RubyEclassChecks(object):
+	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
+
+	def check(self, pkg, ebuild):
+		is_inherited = lambda eclass: eclass in pkg.inherited
+		is_old_ruby_eclass_inherited = filter(
+			is_inherited, self.old_ruby_eclasses)
+
+		if is_old_ruby_eclass_inherited:
+			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+
+			if ruby_intersection:
+				for myruby in ruby_intersection:
+					self.qatracker.add_error(
+						"IUSE.rubydeprecated",
+						(ebuild.relative_path + ": Deprecated ruby target: %s")
+						% myruby)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index f8a4993..bcd2174 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -51,6 +51,7 @@ from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
 from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -67,7 +68,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, max_desc_len, missingvars,
-	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -290,6 +291,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
+rubyeclasscheck = RubyEclassChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -615,18 +617,8 @@ for xpkg in effective_scanlist:
 		ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
 		used_useflags = used_useflags.union(ebuild_used_useflags)
 		#################
-
-		# Check for outdated RUBY targets
-		old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
-		is_old_ruby_eclass_inherited = filter(
-			lambda e: e in inherited, old_ruby_eclasses)
-		if is_old_ruby_eclass_inherited:
-			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
-			if ruby_intersection:
-				for myruby in ruby_intersection:
-					qatracker.add_error("IUSE.rubydeprecated",
-						(ebuild.relative_path + ": Deprecated ruby target: %s")
-						% myruby)
+		rubyeclasscheck.check(pkg, ebuild)
+		#################
 
 		# license checks
 		if not badlicsyntax:


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

commit:     7da878305a0654eb46fdb5a2a2481ee5643833e6
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:58:31 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=7da87830

repoman/main.py: Split Ruby checks to checks/ebuild/eclass/ruby.py

 pym/repoman/checks/ebuilds/eclasses/__init__.py |  0
 pym/repoman/checks/ebuilds/eclasses/ruby.py     | 32 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 18 ++++----------
 3 files changed, 37 insertions(+), 13 deletions(-)

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

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/checks/ebuilds/eclasses/ruby.py
new file mode 100644
index 0000000..abfb166
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/ruby.py
@@ -0,0 +1,32 @@
+
+'''live.py
+Performs Ruby eclass checks
+'''
+
+from repoman.qa_data import ruby_deprecated
+
+
+class RubyEclassChecks(object):
+	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
+
+	def check(self, pkg, ebuild):
+		is_inherited = lambda eclass: eclass in pkg.inherited
+		is_old_ruby_eclass_inherited = filter(
+			is_inherited, self.old_ruby_eclasses)
+
+		if is_old_ruby_eclass_inherited:
+			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+
+			if ruby_intersection:
+				for myruby in ruby_intersection:
+					self.qatracker.add_error(
+						"IUSE.rubydeprecated",
+						(ebuild.relative_path + ": Deprecated ruby target: %s")
+						% myruby)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index f8a4993..bcd2174 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -51,6 +51,7 @@ from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
 from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -67,7 +68,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, max_desc_len, missingvars,
-	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -290,6 +291,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker, options)
 liveeclasscheck = LiveEclassChecks(qatracker)
+rubyeclasscheck = RubyEclassChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -615,18 +617,8 @@ for xpkg in effective_scanlist:
 		ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
 		used_useflags = used_useflags.union(ebuild_used_useflags)
 		#################
-
-		# Check for outdated RUBY targets
-		old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
-		is_old_ruby_eclass_inherited = filter(
-			lambda e: e in inherited, old_ruby_eclasses)
-		if is_old_ruby_eclass_inherited:
-			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
-			if ruby_intersection:
-				for myruby in ruby_intersection:
-					qatracker.add_error("IUSE.rubydeprecated",
-						(ebuild.relative_path + ": Deprecated ruby target: %s")
-						% myruby)
+		rubyeclasscheck.check(pkg, ebuild)
+		#################
 
 		# license checks
 		if not badlicsyntax:


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

commit:     7d2e89a4fc4f1a3a8c88c4b999cb52b11415fa60
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:58:31 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Oct  1 23:45:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7d2e89a4

repoman/main.py: Split Ruby checks to checks/ebuild/eclass/ruby.py

---
 pym/repoman/checks/ebuilds/eclasses/__init__.py |  0
 pym/repoman/checks/ebuilds/eclasses/ruby.py     | 32 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 18 ++++----------
 3 files changed, 37 insertions(+), 13 deletions(-)

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

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/checks/ebuilds/eclasses/ruby.py
new file mode 100644
index 0000000..abfb166
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/ruby.py
@@ -0,0 +1,32 @@
+
+'''live.py
+Performs Ruby eclass checks
+'''
+
+from repoman.qa_data import ruby_deprecated
+
+
+class RubyEclassChecks(object):
+	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
+
+	def check(self, pkg, ebuild):
+		is_inherited = lambda eclass: eclass in pkg.inherited
+		is_old_ruby_eclass_inherited = filter(
+			is_inherited, self.old_ruby_eclasses)
+
+		if is_old_ruby_eclass_inherited:
+			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+
+			if ruby_intersection:
+				for myruby in ruby_intersection:
+					self.qatracker.add_error(
+						"IUSE.rubydeprecated",
+						(ebuild.relative_path + ": Deprecated ruby target: %s")
+						% myruby)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 2cd89b2..1107c63 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -49,6 +49,7 @@ from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
 from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -64,7 +65,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, max_desc_len, missingvars,
-	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -287,6 +288,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker)
 liveeclasscheck = LiveEclassChecks(qatracker)
+rubyeclasscheck = RubyEclassChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -609,18 +611,8 @@ for xpkg in effective_scanlist:
 		ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
 		used_useflags = used_useflags.union(ebuild_used_useflags)
 		#################
-
-		# Check for outdated RUBY targets
-		old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
-		is_old_ruby_eclass_inherited = filter(
-			lambda e: e in inherited, old_ruby_eclasses)
-		if is_old_ruby_eclass_inherited:
-			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
-			if ruby_intersection:
-				for myruby in ruby_intersection:
-					qatracker.add_error("IUSE.rubydeprecated",
-						(ebuild.relative_path + ": Deprecated ruby target: %s")
-						% myruby)
+		rubyeclasscheck.check(pkg, ebuild)
+		#################
 
 		# license checks
 		if not badlicsyntax:


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

commit:     93caaa92a33f3b199e53077d7066d75fb27ac0e3
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:40:35 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Oct  1 23:45:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=93caaa92

repoman/main.py: Split "Live" checks to checks/ebuilds/eclass/live.py

---
 pym/repoman/checks/ebuilds/eclasses/live.py | 39 +++++++++++++++++++++++++
 pym/repoman/main.py                         | 45 ++++++++++++-----------------
 2 files changed, 57 insertions(+), 27 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/live.py b/pym/repoman/checks/ebuilds/eclasses/live.py
new file mode 100644
index 0000000..20c573e
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/live.py
@@ -0,0 +1,39 @@
+
+'''live.py
+Performs Live eclass checks
+'''
+
+from repoman.repos import has_global_mask
+
+
+class LiveEclassChecks(object):
+	'''Performs checks for the usage of Live eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild, keywords, global_pmaskdict):
+		'''Ebuilds that inherit a "Live" eclass (darcs, subversion, git, cvs,
+		etc..) should not be allowed to be marked stable
+
+		@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).
+		@param keywords: The keywords of the ebuild.
+		@param global_pmaskdict: A global dictionary of all the masks.
+		'''
+		is_stable = lambda kw: not kw.startswith("~") and not kw.startswith("-")
+		bad_stable_keywords = list(filter(is_stable, keywords))
+
+		if bad_stable_keywords:
+			self.qatracker.add_error(
+				"LIVEVCS.stable", "%s/%s.ebuild with stable keywords:%s " % (
+					package, y_ebuild, bad_stable_keywords))
+
+		good_keywords_exist = len(bad_stable_keywords) < len(keywords)
+		if good_keywords_exist and not has_global_mask(pkg, global_pmaskdict):
+			self.qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 05d9a14..2cd89b2 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -48,6 +48,7 @@ from portage.package.ebuild.digestgen import digestgen
 from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
+from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -60,16 +61,17 @@ from repoman.ebuild import Ebuild
 from repoman.errors import err
 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,
+from repoman.qa_data import (
+	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, max_desc_len, missingvars,
 	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
-from repoman.repos import has_global_mask, RepoSettings, repo_metadata
+from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
 from repoman._subprocess import repoman_popen, repoman_getstatusoutput
 from repoman import utilities
-from repoman.vcs.vcs import (git_supports_gpg_sign, vcs_files_to_cps,
-	VCSSettings)
+from repoman.vcs.vcs import (
+	git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
 from repoman.vcs.vcsstatus import VCSStatus
 
 
@@ -271,18 +273,21 @@ if options.if_modified == "y":
 		chain(changed.changed, changed.new, changed.removed),
 		repolevel, reposplit, categories))
 
-#######  initialize our checks classes here before the big xpkg loop
+######################
+# initialize our checks classes here before the big xpkg loop
 manifester = Manifests(options, qatracker, repoman_settings)
 is_ebuild = IsEbuild(repoman_settings, repo_settings, portdb, qatracker)
-filescheck = FileChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+filescheck = FileChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 status_check = VCSStatus(vcs_settings, qatracker)
-fetchcheck = FetchChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+fetchcheck = FetchChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 pkgmeta = PkgMetadata(options, qatracker, repoman_settings)
 thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker)
+liveeclasscheck = LiveEclassChecks(qatracker)
+######################
 
 for xpkg in effective_scanlist:
 	# ebuilds and digests added to cvs respectively.
@@ -451,25 +456,11 @@ for xpkg in effective_scanlist:
 				qatracker.add_error("KEYWORDS.stupid",
 					xpkg + "/" + y_ebuild + ".ebuild")
 
-		"""
-		Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
-		not be allowed to be marked stable
-		"""
 		if live_ebuild and repo_settings.repo_config.name == "gentoo":
-			bad_stable_keywords = []
-			for keyword in keywords:
-				if not keyword.startswith("~") and \
-					not keyword.startswith("-"):
-					bad_stable_keywords.append(keyword)
-				del keyword
-			if bad_stable_keywords:
-				qatracker.add_error("LIVEVCS.stable",
-					"%s/%s.ebuild with stable keywords:%s " %
-					(xpkg, y_ebuild, bad_stable_keywords))
-			del bad_stable_keywords
-
-			if keywords and not has_global_mask(pkg, global_pmaskdict):
-				qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
+			#######################
+			liveeclasscheck.check(
+				pkg, xpkg, ebuild, y_ebuild, keywords, global_pmaskdict)
+			#######################
 
 		if options.ignore_arches:
 			arches = [[


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

commit:     c8e550c5bb151409bba1af496f4b853f6b5efa0b
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:58:31 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=c8e550c5

repoman/main.py: Split Ruby checks to checks/ebuild/eclass/ruby.py

---
 pym/repoman/checks/ebuilds/eclasses/__init__.py |  0
 pym/repoman/checks/ebuilds/eclasses/ruby.py     | 32 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 18 ++++----------
 3 files changed, 37 insertions(+), 13 deletions(-)

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

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/checks/ebuilds/eclasses/ruby.py
new file mode 100644
index 0000000..abfb166
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/ruby.py
@@ -0,0 +1,32 @@
+
+'''live.py
+Performs Ruby eclass checks
+'''
+
+from repoman.qa_data import ruby_deprecated
+
+
+class RubyEclassChecks(object):
+	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
+
+	def check(self, pkg, ebuild):
+		is_inherited = lambda eclass: eclass in pkg.inherited
+		is_old_ruby_eclass_inherited = filter(
+			is_inherited, self.old_ruby_eclasses)
+
+		if is_old_ruby_eclass_inherited:
+			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+
+			if ruby_intersection:
+				for myruby in ruby_intersection:
+					self.qatracker.add_error(
+						"IUSE.rubydeprecated",
+						(ebuild.relative_path + ": Deprecated ruby target: %s")
+						% myruby)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 2cd89b2..1107c63 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -49,6 +49,7 @@ from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
 from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -64,7 +65,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, max_desc_len, missingvars,
-	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -287,6 +288,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker)
 liveeclasscheck = LiveEclassChecks(qatracker)
+rubyeclasscheck = RubyEclassChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -609,18 +611,8 @@ for xpkg in effective_scanlist:
 		ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
 		used_useflags = used_useflags.union(ebuild_used_useflags)
 		#################
-
-		# Check for outdated RUBY targets
-		old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
-		is_old_ruby_eclass_inherited = filter(
-			lambda e: e in inherited, old_ruby_eclasses)
-		if is_old_ruby_eclass_inherited:
-			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
-			if ruby_intersection:
-				for myruby in ruby_intersection:
-					qatracker.add_error("IUSE.rubydeprecated",
-						(ebuild.relative_path + ": Deprecated ruby target: %s")
-						% myruby)
+		rubyeclasscheck.check(pkg, ebuild)
+		#################
 
 		# license checks
 		if not badlicsyntax:


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

commit:     97130432a87ca75e6766bc80615d28afb21c4d32
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:40:35 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=97130432

repoman/main.py: Split "Live" checks to checks/ebuilds/eclass/live.py

---
 pym/repoman/checks/ebuilds/eclasses/live.py | 39 +++++++++++++++++++++++++
 pym/repoman/main.py                         | 45 ++++++++++++-----------------
 2 files changed, 57 insertions(+), 27 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/live.py b/pym/repoman/checks/ebuilds/eclasses/live.py
new file mode 100644
index 0000000..20c573e
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/live.py
@@ -0,0 +1,39 @@
+
+'''live.py
+Performs Live eclass checks
+'''
+
+from repoman.repos import has_global_mask
+
+
+class LiveEclassChecks(object):
+	'''Performs checks for the usage of Live eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild, keywords, global_pmaskdict):
+		'''Ebuilds that inherit a "Live" eclass (darcs, subversion, git, cvs,
+		etc..) should not be allowed to be marked stable
+
+		@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).
+		@param keywords: The keywords of the ebuild.
+		@param global_pmaskdict: A global dictionary of all the masks.
+		'''
+		is_stable = lambda kw: not kw.startswith("~") and not kw.startswith("-")
+		bad_stable_keywords = list(filter(is_stable, keywords))
+
+		if bad_stable_keywords:
+			self.qatracker.add_error(
+				"LIVEVCS.stable", "%s/%s.ebuild with stable keywords:%s " % (
+					package, y_ebuild, bad_stable_keywords))
+
+		good_keywords_exist = len(bad_stable_keywords) < len(keywords)
+		if good_keywords_exist and not has_global_mask(pkg, global_pmaskdict):
+			self.qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 05d9a14..2cd89b2 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -48,6 +48,7 @@ from portage.package.ebuild.digestgen import digestgen
 from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
+from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -60,16 +61,17 @@ from repoman.ebuild import Ebuild
 from repoman.errors import err
 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,
+from repoman.qa_data import (
+	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, max_desc_len, missingvars,
 	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
-from repoman.repos import has_global_mask, RepoSettings, repo_metadata
+from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
 from repoman._subprocess import repoman_popen, repoman_getstatusoutput
 from repoman import utilities
-from repoman.vcs.vcs import (git_supports_gpg_sign, vcs_files_to_cps,
-	VCSSettings)
+from repoman.vcs.vcs import (
+	git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
 from repoman.vcs.vcsstatus import VCSStatus
 
 
@@ -271,18 +273,21 @@ if options.if_modified == "y":
 		chain(changed.changed, changed.new, changed.removed),
 		repolevel, reposplit, categories))
 
-#######  initialize our checks classes here before the big xpkg loop
+######################
+# initialize our checks classes here before the big xpkg loop
 manifester = Manifests(options, qatracker, repoman_settings)
 is_ebuild = IsEbuild(repoman_settings, repo_settings, portdb, qatracker)
-filescheck = FileChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+filescheck = FileChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 status_check = VCSStatus(vcs_settings, qatracker)
-fetchcheck = FetchChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+fetchcheck = FetchChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 pkgmeta = PkgMetadata(options, qatracker, repoman_settings)
 thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker)
+liveeclasscheck = LiveEclassChecks(qatracker)
+######################
 
 for xpkg in effective_scanlist:
 	# ebuilds and digests added to cvs respectively.
@@ -451,25 +456,11 @@ for xpkg in effective_scanlist:
 				qatracker.add_error("KEYWORDS.stupid",
 					xpkg + "/" + y_ebuild + ".ebuild")
 
-		"""
-		Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
-		not be allowed to be marked stable
-		"""
 		if live_ebuild and repo_settings.repo_config.name == "gentoo":
-			bad_stable_keywords = []
-			for keyword in keywords:
-				if not keyword.startswith("~") and \
-					not keyword.startswith("-"):
-					bad_stable_keywords.append(keyword)
-				del keyword
-			if bad_stable_keywords:
-				qatracker.add_error("LIVEVCS.stable",
-					"%s/%s.ebuild with stable keywords:%s " %
-					(xpkg, y_ebuild, bad_stable_keywords))
-			del bad_stable_keywords
-
-			if keywords and not has_global_mask(pkg, global_pmaskdict):
-				qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
+			#######################
+			liveeclasscheck.check(
+				pkg, xpkg, ebuild, y_ebuild, keywords, global_pmaskdict)
+			#######################
 
 		if options.ignore_arches:
 			arches = [[


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

commit:     1a1e2aa4e650283004fd9cba23c084b111a70115
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:58:31 2014 +0000
Commit:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
CommitDate: Wed Jun  4 13:58:31 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1a1e2aa4

repoman/main.py: Split Ruby checks to checks/ebuild/eclass/ruby.py

---
 pym/repoman/checks/ebuilds/eclasses/__init__.py |  0
 pym/repoman/checks/ebuilds/eclasses/ruby.py     | 32 +++++++++++++++++++++++++
 pym/repoman/main.py                             | 18 ++++----------
 3 files changed, 37 insertions(+), 13 deletions(-)

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

diff --git a/pym/repoman/checks/ebuilds/eclasses/ruby.py b/pym/repoman/checks/ebuilds/eclasses/ruby.py
new file mode 100644
index 0000000..abfb166
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/ruby.py
@@ -0,0 +1,32 @@
+
+'''live.py
+Performs Ruby eclass checks
+'''
+
+from repoman.qa_data import ruby_deprecated
+
+
+class RubyEclassChecks(object):
+	'''Performs checks for the usage of Ruby eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+		self.old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
+
+	def check(self, pkg, ebuild):
+		is_inherited = lambda eclass: eclass in pkg.inherited
+		is_old_ruby_eclass_inherited = filter(
+			is_inherited, self.old_ruby_eclasses)
+
+		if is_old_ruby_eclass_inherited:
+			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
+
+			if ruby_intersection:
+				for myruby in ruby_intersection:
+					self.qatracker.add_error(
+						"IUSE.rubydeprecated",
+						(ebuild.relative_path + ": Deprecated ruby target: %s")
+						% myruby)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index eb083ca..5762abd 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -42,6 +42,7 @@ from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
 from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
+from repoman.checks.ebuilds.eclasses.ruby import RubyEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -57,7 +58,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, max_desc_len, missingvars,
-	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
+	suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
 from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
@@ -280,6 +281,7 @@ thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker)
 liveeclasscheck = LiveEclassChecks(qatracker)
+rubyeclasscheck = RubyEclassChecks(qatracker)
 ######################
 
 for xpkg in effective_scanlist:
@@ -600,18 +602,8 @@ for xpkg in effective_scanlist:
 		ebuild_used_useflags = use_flag_checks.getUsedUseFlags()
 		used_useflags = used_useflags.union(ebuild_used_useflags)
 		#################
-
-		# Check for outdated RUBY targets
-		old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
-		is_old_ruby_eclass_inherited = filter(
-			lambda e: e in inherited, old_ruby_eclasses)
-		if is_old_ruby_eclass_inherited:
-			ruby_intersection = pkg.iuse.all.intersection(ruby_deprecated)
-			if ruby_intersection:
-				for myruby in ruby_intersection:
-					qatracker.add_error("IUSE.rubydeprecated",
-						(ebuild.relative_path + ": Deprecated ruby target: %s")
-						% myruby)
+		rubyeclasscheck.check(pkg, ebuild)
+		#################
 
 		# license checks
 		if not badlicsyntax:


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

commit:     52b37c2ed257975158031b10bb74418f4e2cf8ae
Author:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  4 13:40:35 2014 +0000
Commit:     Tom Wijsman <tomwij <AT> gentoo <DOT> org>
CommitDate: Wed Jun  4 13:40:35 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=52b37c2e

repoman/main.py: Split "Live" checks to checks/ebuilds/eclass/live.py

---
 pym/repoman/checks/ebuilds/eclasses/live.py | 39 +++++++++++++++++++++++++
 pym/repoman/main.py                         | 45 ++++++++++++-----------------
 2 files changed, 57 insertions(+), 27 deletions(-)

diff --git a/pym/repoman/checks/ebuilds/eclasses/live.py b/pym/repoman/checks/ebuilds/eclasses/live.py
new file mode 100644
index 0000000..20c573e
--- /dev/null
+++ b/pym/repoman/checks/ebuilds/eclasses/live.py
@@ -0,0 +1,39 @@
+
+'''live.py
+Performs Live eclass checks
+'''
+
+from repoman.repos import has_global_mask
+
+
+class LiveEclassChecks(object):
+	'''Performs checks for the usage of Live eclasses in ebuilds'''
+
+	def __init__(self, qatracker):
+		'''
+		@param qatracker: QATracker instance
+		'''
+		self.qatracker = qatracker
+
+	def check(self, pkg, package, ebuild, y_ebuild, keywords, global_pmaskdict):
+		'''Ebuilds that inherit a "Live" eclass (darcs, subversion, git, cvs,
+		etc..) should not be allowed to be marked stable
+
+		@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).
+		@param keywords: The keywords of the ebuild.
+		@param global_pmaskdict: A global dictionary of all the masks.
+		'''
+		is_stable = lambda kw: not kw.startswith("~") and not kw.startswith("-")
+		bad_stable_keywords = list(filter(is_stable, keywords))
+
+		if bad_stable_keywords:
+			self.qatracker.add_error(
+				"LIVEVCS.stable", "%s/%s.ebuild with stable keywords:%s " % (
+					package, y_ebuild, bad_stable_keywords))
+
+		good_keywords_exist = len(bad_stable_keywords) < len(keywords)
+		if good_keywords_exist and not has_global_mask(pkg, global_pmaskdict):
+			self.qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
\ No newline at end of file

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 62c1509..eb083ca 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -41,6 +41,7 @@ from portage.package.ebuild.digestgen import digestgen
 from repoman.argparser import parse_args
 from repoman.checks.directories.files import FileChecks
 from repoman.checks.ebuilds.checks import run_checks, checks_init
+from repoman.checks.ebuilds.eclasses.live import LiveEclassChecks
 from repoman.checks.ebuilds.fetches import FetchChecks
 from repoman.checks.ebuilds.keywords import KeywordChecks
 from repoman.checks.ebuilds.isebuild import IsEbuild
@@ -53,16 +54,17 @@ from repoman.ebuild import Ebuild
 from repoman.errors import err
 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,
+from repoman.qa_data import (
+	format_qa_output, format_qa_output_column, qahelp,
 	qawarnings, qacats, max_desc_len, missingvars,
 	ruby_deprecated, suspect_virtual, suspect_rdepend, valid_restrict)
 from repoman.qa_tracker import QATracker
-from repoman.repos import has_global_mask, RepoSettings, repo_metadata
+from repoman.repos import RepoSettings, repo_metadata
 from repoman.scan import Changes, scan
 from repoman._subprocess import repoman_popen, repoman_getstatusoutput
 from repoman import utilities
-from repoman.vcs.vcs import (git_supports_gpg_sign, vcs_files_to_cps,
-	VCSSettings)
+from repoman.vcs.vcs import (
+	git_supports_gpg_sign, vcs_files_to_cps, VCSSettings)
 from repoman.vcs.vcsstatus import VCSStatus
 
 
@@ -264,18 +266,21 @@ if options.if_modified == "y":
 		chain(changed.changed, changed.new, changed.removed),
 		repolevel, reposplit, categories))
 
-#######  initialize our checks classes here before the big xpkg loop
+######################
+# initialize our checks classes here before the big xpkg loop
 manifester = Manifests(options, qatracker, repoman_settings)
 is_ebuild = IsEbuild(repoman_settings, repo_settings, portdb, qatracker)
-filescheck = FileChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+filescheck = FileChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 status_check = VCSStatus(vcs_settings, qatracker)
-fetchcheck = FetchChecks(qatracker, repoman_settings, repo_settings, portdb,
-	vcs_settings)
+fetchcheck = FetchChecks(
+	qatracker, repoman_settings, repo_settings, portdb, vcs_settings)
 pkgmeta = PkgMetadata(options, qatracker, repoman_settings)
 thirdparty = ThirdPartyMirrors(repoman_settings, qatracker)
 use_flag_checks = USEFlagChecks(qatracker, uselist)
 keywordcheck = KeywordChecks(qatracker)
+liveeclasscheck = LiveEclassChecks(qatracker)
+######################
 
 for xpkg in effective_scanlist:
 	# ebuilds and digests added to cvs respectively.
@@ -449,25 +454,11 @@ for xpkg in effective_scanlist:
 				qatracker.add_error("KEYWORDS.stupid",
 					xpkg + "/" + y_ebuild + ".ebuild")
 
-		"""
-		Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
-		not be allowed to be marked stable
-		"""
 		if live_ebuild and repo_settings.repo_config.name == "gentoo":
-			bad_stable_keywords = []
-			for keyword in keywords:
-				if not keyword.startswith("~") and \
-					not keyword.startswith("-"):
-					bad_stable_keywords.append(keyword)
-				del keyword
-			if bad_stable_keywords:
-				qatracker.add_error("LIVEVCS.stable",
-					"%s/%s.ebuild with stable keywords:%s " %
-					(xpkg, y_ebuild, bad_stable_keywords))
-			del bad_stable_keywords
-
-			if keywords and not has_global_mask(pkg, global_pmaskdict):
-				qatracker.add_error("LIVEVCS.unmasked", ebuild.relative_path)
+			#######################
+			liveeclasscheck.check(
+				pkg, xpkg, ebuild, y_ebuild, keywords, global_pmaskdict)
+			#######################
 
 		if options.ignore_arches:
 			arches = [[


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

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

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

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