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 9F62D138B38 for ; Mon, 27 Jan 2014 03:13:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 357C5E0B5B; Mon, 27 Jan 2014 03:13:52 +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 9AF2CE0B5B for ; Mon, 27 Jan 2014 03:13:51 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6F78E33F5E1 for ; Mon, 27 Jan 2014 03:13:50 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 2F33318096 for ; Mon, 27 Jan 2014 03:13:49 +0000 (UTC) From: "Chris Reffett" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Chris Reffett" Message-ID: <1390792324.00560e0b22059ffb42d965b4ef625950ab987afc.creffett@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/checks.py X-VCS-Directories: pym/repoman/ X-VCS-Committer: creffett X-VCS-Committer-Name: Chris Reffett X-VCS-Revision: 00560e0b22059ffb42d965b4ef625950ab987afc X-VCS-Branch: master Date: Mon, 27 Jan 2014 03:13:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d4fe847d-cd46-4a31-b12d-9c3144a81244 X-Archives-Hash: 000e7b73c51c8ed629bd5b4157345a66 commit: 00560e0b22059ffb42d965b4ef625950ab987afc Author: Chris Reffett gentoo org> AuthorDate: Tue Jan 14 00:01:25 2014 +0000 Commit: Chris Reffett gentoo org> CommitDate: Mon Jan 27 03:12:04 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=00560e0b Add src_{prepare, configure} and pkg_pretend checks to repoman EAPI 0/1: Warn if src_configure/src_pretend used EAPI < 4: Warn if pkg_pretend is used Fixes bug 379491. Acked-by: Mike Frysinger gentoo.org> --- pym/repoman/checks.py | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 85aa065..8032b28 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -1,5 +1,5 @@ # repoman: Checks -# Copyright 2007-2013 Gentoo Foundation +# Copyright 2007-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 """This module contains functions used in Repoman to ascertain the quality @@ -15,7 +15,7 @@ import repoman.errors as errors import portage from portage.eapi import eapi_supports_prefix, eapi_has_implicit_rdepend, \ eapi_has_src_prepare_and_src_configure, eapi_has_dosed_dohard, \ - eapi_exports_AA + eapi_exports_AA, eapi_has_pkg_pretend class LineCheck(object): """Run a check on a line of an ebuild.""" @@ -731,6 +731,21 @@ class DeprecatedHasq(LineCheck): re = re.compile(r'(^|.*\b)hasq\b') error = errors.HASQ_ERROR +# EAPI <2 checks +class UndefinedSrcPrepareSrcConfigurePhases(LineCheck): + repoman_check_name = 'EAPI.incompatible' + src_configprepare_re = re.compile(r'\s*(src_configure|src_prepare)\s*\(\)') + + def check_eapi(self, eapi): + return not eapi_has_src_prepare_and_src_configure(eapi) + + 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 < 2 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 UndefinedPkgPretendPhase(LineCheck): + repoman_check_name = 'EAPI.incompatible' + pkg_pretend_re = re.compile(r'\s*(pkg_pretend)\s*\(\)') + + def check_eapi(self, eapi): + return not eapi_has_pkg_pretend(eapi) + + 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'