From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-856585-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id E84B01388BF
	for <garchives@archives.gentoo.org>; Mon, 11 Jan 2016 06:31:23 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id AF6EF21C01F;
	Mon, 11 Jan 2016 06:31:17 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 9FA01E0863
	for <gentoo-commits@lists.gentoo.org>; Mon, 11 Jan 2016 06:31:15 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id B1A3C340813
	for <gentoo-commits@lists.gentoo.org>; Mon, 11 Jan 2016 06:31:14 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 9D72AE61
	for <gentoo-commits@lists.gentoo.org>; Mon, 11 Jan 2016 06:31:10 +0000 (UTC)
From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" <dolsen@gentoo.org>
Message-ID: <1452466775.a75fbc2fb47f5f76e71ddbcc2c4e6a04067eeb97.dolsen@gentoo>
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/metadata/
X-VCS-Repository: proj/portage
X-VCS-Files: pym/repoman/modules/scan/metadata/ebuild_metadata.py pym/repoman/scanner.py
X-VCS-Directories: pym/repoman/ pym/repoman/modules/scan/metadata/
X-VCS-Committer: dolsen
X-VCS-Committer-Name: Brian Dolbec
X-VCS-Revision: a75fbc2fb47f5f76e71ddbcc2c4e6a04067eeb97
X-VCS-Branch: repoman
Date: Mon, 11 Jan 2016 06:31:10 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 2b433ca1-6cc4-4ab4-b9a7-8f9fa581de2e
X-Archives-Hash: 2d98d3d835a64ce4c37a30732b833e44

commit:     a75fbc2fb47f5f76e71ddbcc2c4e6a04067eeb97
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Jan  3 11:56:25 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Jan 10 22:59:35 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a75fbc2f

repoman: Migrate more metadata checks to ebuild_metadata.py

 .../modules/scan/metadata/ebuild_metadata.py       | 32 ++++++++++++++++++++--
 pym/repoman/scanner.py                             | 17 ------------
 2 files changed, 30 insertions(+), 19 deletions(-)

diff --git a/pym/repoman/modules/scan/metadata/ebuild_metadata.py b/pym/repoman/modules/scan/metadata/ebuild_metadata.py
index 2dc1db2..77c947e 100644
--- a/pym/repoman/modules/scan/metadata/ebuild_metadata.py
+++ b/pym/repoman/modules/scan/metadata/ebuild_metadata.py
@@ -5,6 +5,8 @@
 import re
 import sys
 
+from repoman.qa_data import missingvars
+
 if sys.hexversion >= 0x3000000:
 	basestring = str
 
@@ -16,7 +18,7 @@ class EbuildMetadata(object):
 	def __init__(self, **kwargs):
 		self.qatracker = kwargs.get('qatracker')
 
-	def check(self, **kwargs):
+	def invalidchar(self, **kwargs):
 		ebuild = kwargs.get('ebuild')
 		for k, v in ebuild.metadata.items():
 			if not isinstance(v, basestring):
@@ -28,9 +30,35 @@ class EbuildMetadata(object):
 					"%s: %s variable contains non-ASCII "
 					"character at position %s" %
 					(ebuild.relative_path, k, m.start() + 1))
+		return {'continue': False}
+
+	def missing(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		for pos, missing_var in enumerate(missingvars):
+			if not ebuild.metadata.get(missing_var):
+				if kwargs.get('catdir') == "virtual" and \
+					missing_var in ("HOMEPAGE", "LICENSE"):
+					continue
+				if kwargs.get('live_ebuild') and missing_var == "KEYWORDS":
+					continue
+				myqakey = missingvars[pos] + ".missing"
+				self.qatracker.add_error(myqakey, '%s/%s.ebuild'
+					% (kwargs.get('xpkg'), kwargs.get('y_ebuild')))
+		return {'continue': False}
+
+	def old_virtual(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
 		if ebuild.metadata.get("PROVIDE"):
 			self.qatracker.add_error("virtual.oldstyle", ebuild.relative_path)
+		return {'continue': False}
 
+	def virtual(self, **kwargs):
+		ebuild = kwargs.get('ebuild')
+		if kwargs.get('catdir') == "virtual":
+			for var in ("HOMEPAGE", "LICENSE"):
+				if ebuild.metadata.get(var):
+					myqakey = var + ".virtual"
+					self.qatracker.add_error(myqakey, ebuild.relative_path)
 		return {'continue': False}
 
 	@property
@@ -39,4 +67,4 @@ class EbuildMetadata(object):
 
 	@property
 	def runInEbuilds(self):
-		return (True, [self.check])
+		return (True, [self.invalidchar, self.missing, self.old_virtual, self.virtual])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 46f46f5..d42fd33 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -324,23 +324,6 @@ class Scanner(object):
 			if y_ebuild_continue:
 				continue
 
-
-			for pos, missing_var in enumerate(missingvars):
-				if not dynamic_data['ebuild'].metadata.get(missing_var):
-					if dynamic_data['catdir'] == "virtual" and \
-						missing_var in ("HOMEPAGE", "LICENSE"):
-						continue
-					if dynamic_data['live_ebuild'] and missing_var == "KEYWORDS":
-						continue
-					myqakey = missingvars[pos] + ".missing"
-					self.qatracker.add_error(myqakey, xpkg + "/" + y_ebuild + ".ebuild")
-
-			if dynamic_data['catdir'] == "virtual":
-				for var in ("HOMEPAGE", "LICENSE"):
-					if dynamic_data['ebuild'].metadata.get(var):
-						myqakey = var + ".virtual"
-						self.qatracker.add_error(myqakey, dynamic_data['ebuild'].relative_path)
-
 			if dynamic_data['live_ebuild'] and self.repo_settings.repo_config.name == "gentoo":
 				self.liveeclasscheck.check(
 					dynamic_data['pkg'], xpkg, dynamic_data['ebuild'], y_ebuild, dynamic_data['ebuild'].keywords, self.repo_metadata['pmaskdict'])