public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/depend/, pym/repoman/
Date: Fri, 29 Jan 2016 05:01:06 +0000 (UTC)	[thread overview]
Message-ID: <1454043179.5514c7f91b65f07d5699535a99ed55bac9605c56.dolsen@gentoo> (raw)

commit:     5514c7f91b65f07d5699535a99ed55bac9605c56
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jan  4 08:09:33 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Jan 29 04:52:59 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=5514c7f9

repoman: Create a new DependUnknown plugin class

 pym/repoman/modules/scan/depend/__init__.py |  9 +++++++++
 pym/repoman/modules/scan/depend/unknown.py  | 30 +++++++++++++++++++++++++++++
 pym/repoman/scanner.py                      | 10 +---------
 3 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/pym/repoman/modules/scan/depend/__init__.py b/pym/repoman/modules/scan/depend/__init__.py
index cddb7f1..9fd7970 100644
--- a/pym/repoman/modules/scan/depend/__init__.py
+++ b/pym/repoman/modules/scan/depend/__init__.py
@@ -28,6 +28,15 @@ module_spec = {
 			'func_desc': {
 			},
 		},
+		'unknown-module': {
+			'name': "unknown",
+			'sourcefile': "unknown",
+			'class': "DependUnknown",
+			'description': doc,
+			'functions': ['check'],
+			'func_desc': {
+			},
+		},
 	}
 }
 

diff --git a/pym/repoman/modules/scan/depend/unknown.py b/pym/repoman/modules/scan/depend/unknown.py
new file mode 100644
index 0000000..61d51b9
--- /dev/null
+++ b/pym/repoman/modules/scan/depend/unknown.py
@@ -0,0 +1,30 @@
+# -*- coding:utf-8 -*-
+
+
+class DependUnknown(object):
+
+	def __init__(self, **kwargs):
+		self.qatracker = kwargs.get('qatracker')
+
+	def check(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		baddepsyntax = kwargs.get('baddepsyntax')
+		unknown_pkgs = kwargs.get('unknown_pkgs')
+
+		if not baddepsyntax and unknown_pkgs:
+			type_map = {}
+			for mytype, atom in unknown_pkgs:
+				type_map.setdefault(mytype, set()).add(atom)
+			for mytype, atoms in type_map.items():
+				self.qatracker.add_error(
+					"dependency.unknown", "%s: %s: %s"
+					% (ebuild.relative_path, mytype, ", ".join(sorted(atoms))))
+		return {'continue': False}
+
+	@property
+	def runInPkgs(self):
+		return (False, [])
+
+	@property
+	def runInEbuilds(self):
+		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index bd337fc..4472f88 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -292,6 +292,7 @@ class Scanner(object):
 				('mtime', 'MtimeChecks'), ('multicheck', 'MultiCheck'),
 				# Options.is_forced() is used to bypass further checks
 				('options', 'Options'), ('profile', 'ProfileDependsChecks'),
+				('unknown', 'DependUnknown'),
 				]:
 				if mod[0]:
 					mod_class = MODULE_CONTROLLER.get_class(mod[0])
@@ -319,15 +320,6 @@ class Scanner(object):
 			if y_ebuild_continue:
 				continue
 
-			if not dynamic_data['baddepsyntax'] and dynamic_data['unknown_pkgs']:
-				type_map = {}
-				for mytype, atom in dynamic_data['unknown_pkgs']:
-					type_map.setdefault(mytype, set()).add(atom)
-				for mytype, atoms in type_map.items():
-					self.qatracker.add_error(
-						"dependency.unknown", "%s: %s: %s"
-						% (dynamic_data['ebuild'].relative_path, mytype, ", ".join(sorted(atoms))))
-
 		# check if there are unused local USE-descriptions in metadata.xml
 		# (unless there are any invalids, to avoid noise)
 		if dynamic_data['allvalid']:


             reply	other threads:[~2016-01-29  5:01 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29  5:01 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-03-12 18:10 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/modules/scan/depend/, pym/repoman/ Brian Dolbec
2016-03-11  0:41 Brian Dolbec
2016-03-07 21:53 Brian Dolbec
2016-03-07 21:53 Brian Dolbec
2016-01-31 20:03 Brian Dolbec
2016-01-31 20:03 Brian Dolbec
2016-01-30  8:00 Brian Dolbec
2016-01-30  6:58 Brian Dolbec
2016-01-30  6:58 Brian Dolbec
2016-01-30  6:58 Brian Dolbec
2016-01-30  6:58 Brian Dolbec
2016-01-29  5:01 Brian Dolbec
2016-01-27 23:15 Brian Dolbec
2016-01-23  1:42 Brian Dolbec
2016-01-23  1:42 Brian Dolbec
2016-01-21 19:42 Brian Dolbec
2016-01-21 18:30 Brian Dolbec
2016-01-18 19:23 Brian Dolbec
2016-01-11  8:01 Brian Dolbec
2016-01-11  6:31 Brian Dolbec
2016-01-11  6:31 Brian Dolbec
2016-01-10 20:17 Brian Dolbec
2016-01-10 20:17 Brian Dolbec
2016-01-10  3:26 Brian Dolbec
2016-01-10  3:26 Brian Dolbec
2016-01-10  3:26 Brian Dolbec
2016-01-06  4:21 Brian Dolbec
2016-01-06  4:21 Brian Dolbec
2016-01-06  4:21 Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454043179.5514c7f91b65f07d5699535a99ed55bac9605c56.dolsen@gentoo \
    --to=dolsen@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox