summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-01-18 23:43:54 +0000
committerZac Medico <zmedico@gentoo.org>2009-01-18 23:43:54 +0000
commit851a9149d4bb61727fb71ecb8145f6b26e9090fb (patch)
tree9454c4e1bfe4b69d5e1a4b96fe4ffdd41aa5cdba
parentFix false positive in the 'unused local USE-description' warning. Thanks to (diff)
downloadportage-multirepo-2.1.6.7.tar.gz
portage-multirepo-2.1.6.7.tar.bz2
portage-multirepo-2.1.6.7.zip
Bug #255358 - Add new RDEPEND.implicit warning to detect the caes where DEPENDv2.1.6.7
is set and RDEPEND is unset in the ebuild, since this triggers implicit RDEPEND=$DEPEND assignment. (trunk r12529) svn path=/main/branches/2.1.6/; revision=12537
-rwxr-xr-xbin/repoman2
-rw-r--r--man/repoman.14
-rw-r--r--pym/repoman/checks.py29
3 files changed, 34 insertions, 1 deletions
diff --git a/bin/repoman b/bin/repoman
index 99f37cc8..3696f717 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -305,6 +305,7 @@ qahelp={
"IUSE.undefined":"This ebuild does not define IUSE (style guideline says to define IUSE even when empty)",
"LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.",
"KEYWORDS.invalid":"This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found",
+ "RDEPEND.implicit":"RDEPEND is unset in the ebuild which triggers implicit RDEPEND=$DEPEND assignment",
"RDEPEND.suspect":"RDEPEND contains a package that usually only belongs in DEPEND.",
"RESTRICT.invalid":"This ebuild contains invalid RESTRICT values.",
"digestentry.unused":"Some files listed in the Manifest aren't referenced in SRC_URI",
@@ -343,6 +344,7 @@ qawarnings = set((
"KEYWORDS.stupid",
"KEYWORDS.missing",
"IUSE.undefined",
+"RDEPEND.implicit",
"RDEPEND.suspect",
"RESTRICT.invalid",
"SRC_URI.mirror",
diff --git a/man/repoman.1 b/man/repoman.1
index a5f56b35..b8b8f5de 100644
--- a/man/repoman.1
+++ b/man/repoman.1
@@ -168,6 +168,10 @@ Masked ebuilds with RDEPEND settings (matched against *all* ebuilds)
.B RDEPEND.badmaskedindev
Masked ebuilds with RDEPEND settings (matched against *all* ebuilds) in developing arch
.TP
+.B RDEPEND.implicit
+RDEPEND is unset in the ebuild which triggers implicit RDEPEND=$DEPEND
+assignment
+.TP
.B RDEPEND.suspect
RDEPEND contains a package that usually only belongs in DEPEND
.TP
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 7565039f..c9ef91cf 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):