From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 55FA9138247 for ; Wed, 15 Jan 2014 14:34:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 93F24E0B68; Wed, 15 Jan 2014 14:34:24 +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 14070E0B63 for ; Wed, 15 Jan 2014 14:34:24 +0000 (UTC) Received: from localhost.localdomain (unknown [184.53.0.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: creffett) by smtp.gentoo.org (Postfix) with ESMTPSA id 9ADA933F281; Wed, 15 Jan 2014 14:34:18 +0000 (UTC) From: Chris Reffett To: gentoo-portage-dev@lists.gentoo.org Cc: Chris Reffett Subject: [gentoo-portage-dev] [PATCH v2] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI < 4. Fixes bug 379491. Date: Wed, 15 Jan 2014 09:33:09 -0500 Message-Id: <1389796389-9917-1-git-send-email-creffett@gentoo.org> X-Mailer: git-send-email 1.8.5.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: bcc1a919-3b04-4abc-8903-b543928e9491 X-Archives-Hash: 7177d0c35f4177a0eff0b8432c357e93 --- pym/repoman/checks.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 85aa065..5c55b0d 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -731,6 +731,21 @@ class DeprecatedHasq(LineCheck): re = re.compile(r'(^|.*\b)hasq\b') error = errors.HASQ_ERROR +# EAPI <2 checks +class Eapi01UndefinedPhases(LineCheck): + repoman_check_name = 'EAPI.incompatible' + src_configprepare_re = re.compile(r'\s*src_(configure|prepare)\s*\(\)') + + def check_eapi(self, eapi): + return eapi in ('0', '1') + + def check(self, num, line): + m = self.src_configprepare__re.match(line) + if m is not None: + return ("%s" % m.group(1)) + \ + " phase is not defined in EAPI=0/1 on line: %d" + + # EAPI-3 checks class Eapi3DeprecatedFuncs(LineCheck): repoman_check_name = 'EAPI.deprecated' @@ -745,6 +760,20 @@ class Eapi3DeprecatedFuncs(LineCheck): return ("'%s'" % m.group(1)) + \ " has been deprecated in EAPI=3 on line: %d" +# EAPI <4 checks +class Eapi0123UndefinedPhases(LineCheck): + repoman_check_name = 'EAPI.incompatible' + pkg_pretend_re = re.compile(r'\s*pkg_pretend\s*\(\)') + + def check_eapi(self, eapi): + return eapi in ('0', '1', '2', '3') + + def check(self, num, line): + m = self.pkg_pretend_re.match(line) + if m is not None: + return ("%s" % m.group(1)) + \ + " phase is not defined in EAPI < 4 on line: %d" + # EAPI-4 checks class Eapi4IncompatibleFuncs(LineCheck): repoman_check_name = 'EAPI.incompatible' -- 1.8.5.1