summaryrefslogtreecommitdiffstats
path: root/pym/repoman
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2010-08-11 10:11:58 +0200
committerZac Medico <zmedico@gentoo.org>2010-08-11 01:19:35 -0700
commitca288e594b1160157c9743250422973d30587f0a (patch)
treec45c3fbceb7fa6a77b91151abcdc2862cf44f5eb /pym/repoman
parentddd207ef7fd6b57f464bd9f2d8890eb7dbd9f0d4 (diff)
downloadportage-ca288e594b1160157c9743250422973d30587f0a.tar.gz
portage-ca288e594b1160157c9743250422973d30587f0a.tar.bz2
portage-ca288e594b1160157c9743250422973d30587f0a.zip
Introduce portage.eapi. Use it everywhere.
Diffstat (limited to 'pym/repoman')
-rw-r--r--pym/repoman/checks.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 7e76bf782..67333419f 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -1,5 +1,5 @@
# repoman: Checks
-# Copyright 2007 Gentoo Foundation
+# Copyright 2007, 2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
"""This module contains functions used in Repoman to ascertain the quality
@@ -8,6 +8,7 @@ and correctness of an ebuild."""
import re
import time
import repoman.errors as errors
+from portage.eapi import *
class LineCheck(object):
"""Run a check on a line of an ebuild."""
@@ -230,7 +231,7 @@ class Eapi3EbuildAssignment(EbuildAssignment):
readonly_assignment = re.compile(r'\s*(export\s+)?(ED|EPREFIX|EROOT)=')
def check_eapi(self, eapi):
- return eapi not in ('0', '1', '2')
+ return eapi_supports_prefix(eapi)
class EbuildNestedDie(LineCheck):
"""Check ebuild for nested die statements (die statements in subshells"""
@@ -341,7 +342,7 @@ class ImplicitRuntimeDeps(LineCheck):
# Beginning with EAPI 4, there is no
# implicit RDEPEND=$DEPEND assignment
# to be concerned with.
- return eapi in ('0', '1', '2', '3')
+ return eapi_has_implicit_rdepend(eapi)
def check(self, num, line):
if not self._rdepend:
@@ -467,7 +468,7 @@ class SrcCompileEconf(PhaseCheck):
configure_re = re.compile(r'\s(econf|./configure)')
def check_eapi(self, eapi):
- return eapi not in ('0', '1')
+ return eapi_has_src_prepare_and_src_configure(eapi)
def phase_check(self, num, line):
if self.in_phase == 'src_compile':
@@ -481,7 +482,7 @@ class SrcUnpackPatches(PhaseCheck):
src_prepare_tools_re = re.compile(r'\s(e?patch|sed)\s')
def check_eapi(self, eapi):
- return eapi not in ('0', '1')
+ return eapi_has_src_prepare_and_src_configure(eapi)
def phase_check(self, num, line):
if self.in_phase == 'src_unpack':
@@ -518,7 +519,7 @@ class Eapi4IncompatibleFuncs(LineCheck):
banned_commands_re = re.compile(r'^\s*(dosed|dohard)')
def check_eapi(self, eapi):
- return eapi not in ('0', '1', '2', '3', '3_pre2')
+ return not eapi_has_dosed_dohard(eapi)
def check(self, num, line):
m = self.banned_commands_re.match(line)
@@ -532,7 +533,7 @@ class Eapi4GoneVars(LineCheck):
undefined_vars_re = re.compile(r'.*\$(\{(AA|KV)\}|(AA|KV))')
def check_eapi(self, eapi):
- return eapi not in ('0', '1', '2', '3', '3_pre2')
+ return not eapi_exports_AA(eapi) or not eapi_exports_KV(eapi)
def check(self, num, line):
m = self.undefined_vars_re.match(line)