* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/
@ 2014-11-17 0:55 Brian Dolbec
0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2014-11-17 0:55 UTC (permalink / raw
To: gentoo-commits
commit: ced8f5ca06eb6c3c64c4d0ef87d80db9181e837e
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: Mon Nov 17 00:53:14 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ced8f5ca
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] 9+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/
@ 2014-11-17 0:55 Brian Dolbec
0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2014-11-17 0:55 UTC (permalink / raw
To: gentoo-commits
commit: 7bc6b15b7577c085b66091c6b5b744c3c7e8e39b
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: Mon Nov 17 00:53:14 2014 +0000
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7bc6b15b
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] 9+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/
@ 2015-08-10 13:44 Brian Dolbec
0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2015-08-10 13:44 UTC (permalink / raw
To: gentoo-commits
commit: c265a22873464359c4882a8dad8807f07a69b02b
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 Jul 21 05:47:29 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c265a228
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 79a24da..2177958 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] 9+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/
@ 2015-08-10 13:44 Brian Dolbec
0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2015-08-10 13:44 UTC (permalink / raw
To: gentoo-commits
commit: 92e27786094479bef0014450573d7ba58990f928
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 Jul 21 05:47:29 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=92e27786
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 2177958..8b9e73d 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] 9+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/
@ 2015-08-10 14:45 Michał Górny
0 siblings, 0 replies; 9+ messages in thread
From: Michał Górny @ 2015-08-10 14:45 UTC (permalink / raw
To: gentoo-commits
commit: d32806b558426a5c0702bddde8346a3ef942c365
Author: Tom Wijsman <tomwij <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 4 13:40:35 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=d32806b5
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] 9+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/
@ 2015-09-05 21:27 Brian Dolbec
0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2015-09-05 21:27 UTC (permalink / raw
To: gentoo-commits
commit: c1f364d1c7e7f5a17f612039481b59d9e4f56c37
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:26:59 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c1f364d1
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] 9+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/
@ 2015-09-17 3:08 Brian Dolbec
0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2015-09-17 3:08 UTC (permalink / raw
To: gentoo-commits
commit: ffec253c1a40c3782aa22259d58710ae03c56880
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 03:06:48 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ffec253c
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] 9+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/
@ 2015-09-17 4:51 Brian Dolbec
0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2015-09-17 4:51 UTC (permalink / raw
To: gentoo-commits
commit: 2929b2392d07dfa07be2660f863a53d685cef252
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 04:41:26 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=2929b239
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 63eed0a..39c8e1a 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] 9+ messages in thread
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/
@ 2015-09-20 2:06 Brian Dolbec
0 siblings, 0 replies; 9+ messages in thread
From: Brian Dolbec @ 2015-09-20 2:06 UTC (permalink / raw
To: gentoo-commits
commit: f45a855d52e19843f29665a6d3fe16dd3aa6ed41
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: Sun Sep 20 01:54:07 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f45a855d
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] 9+ messages in thread
end of thread, other threads:[~2015-09-20 2:06 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-20 2:06 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/checks/ebuilds/eclasses/, pym/repoman/ Brian Dolbec
-- strict thread matches above, loose matches on Subject: below --
2015-09-17 4:51 Brian Dolbec
2015-09-17 3:08 Brian Dolbec
2015-09-05 21:27 Brian Dolbec
2015-08-10 14:45 Michał Górny
2015-08-10 13:44 Brian Dolbec
2015-08-10 13:44 Brian Dolbec
2014-11-17 0:55 Brian Dolbec
2014-11-17 0:55 Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox