summaryrefslogtreecommitdiffstats
path: root/pym/repoman/checks.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-01-18 23:15:47 +0000
committerZac Medico <zmedico@gentoo.org>2009-01-18 23:15:47 +0000
commit2acca867498d5f260c41f531a029ec4cb31b7435 (patch)
tree87a3eef2ca30af9b5108aa29840b07cac7a30da6 /pym/repoman/checks.py
parent42eb4ea70259dc0e24a5767a4d8f815d632ba228 (diff)
downloadportage-2acca867498d5f260c41f531a029ec4cb31b7435.tar.gz
portage-2acca867498d5f260c41f531a029ec4cb31b7435.tar.bz2
portage-2acca867498d5f260c41f531a029ec4cb31b7435.zip
Bug #255358 - Add new RDEPEND.implicit warning to detect the caes where DEPENDv2.2_rc23
is set and RDEPEND is unset in the ebuild, since this triggers implicit RDEPEND=$DEPEND assignment. svn path=/main/trunk/; revision=12529
Diffstat (limited to 'pym/repoman/checks.py')
-rw-r--r--pym/repoman/checks.py29
1 files changed, 28 insertions, 1 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 7565039f2..c9ef91cfc 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -230,6 +230,33 @@ class EbuildQuotedA(LineCheck):
if match:
return "Quoted \"${A}\" on line: %d"
+class ImplicitRuntimeDeps(LineCheck):
+ """
+ Detect the case where DEPEND is set and RDEPEND is unset in the ebuild,
+ since this triggers implicit RDEPEND=$DEPEND assignment.
+ """
+
+ repoman_check_name = 'RDEPEND.implicit'
+ _assignment_re = re.compile(r'^\s*(R?DEPEND)=')
+
+ def new(self, pkg):
+ self._rdepend = False
+ self._depend = False
+
+ def check(self, num, line):
+ if not self._rdepend:
+ m = self._assignment_re.match(line)
+ if m is None:
+ pass
+ elif m.group(1) == "RDEPEND":
+ self._rdepend = True
+ elif m.group(1) == "DEPEND":
+ self._depend = True
+
+ def end(self):
+ if self._depend and not self._rdepend:
+ yield 'RDEPEND is not explicitly assigned'
+
class InheritAutotools(LineCheck):
"""
Make sure appropriate functions are called in
@@ -306,7 +333,7 @@ _constant_checks = tuple((c() for c in (
EbuildAssignment, EbuildUselessDodoc,
EbuildUselessCdS, EbuildNestedDie,
EbuildPatches, EbuildQuotedA,
- IUseUndefined, InheritAutotools,
+ IUseUndefined, ImplicitRuntimeDeps, InheritAutotools,
EMakeParallelDisabled, DeprecatedBindnowFlags)))
def run_checks(contents, pkg):