From 5f0f322ec88c11950d9071ed09203b6723654d5d Mon Sep 17 00:00:00 2001 From: Joachim Filip Ignacy Bartosik Date: Sat, 17 Apr 2010 14:28:21 +0200 Subject: [PATCH] Added check for P in SRC_URI, no tests for check. --- pym/repoman/checks.py | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 23f1267..6879bea 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -436,6 +436,21 @@ class BuiltWithUse(LineCheck): re = re.compile('^.*built_with_use') error = errors.BUILT_WITH_USE +class PNotInSourceUri(LineCheck): + fail = False + pv = '' + + def new(self, pkg): + self.pv = pkg.cpv_split[1] + '.' + pkg.cpv_split[2] + self.re = re.compile(self.pv, re.I) + self.src_uri = pkg.metadata["SRC_URI"] + self.fail = self.re.search( self.src_uri) + + def check(self, num, line): + if self.fail: + return "SRC_URI: '" + self.src_uri + "' conntains $P: '" \ + + self.pv + "' but it shouldn't." + # EAPI-3 checks class Eapi3DeprecatedFuncs(LineCheck): repoman_check_name = 'EAPI.deprecated' -- 1.7.0.4