]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oelint.bbclass: Check for ${PN} or ${P} usage
authorChong Lu <Chong.Lu@windriver.com>
Fri, 1 Aug 2014 09:03:38 +0000 (17:03 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 6 Aug 2014 09:22:42 +0000 (10:22 +0100)
Check for ${PN} or ${P} usage in SRC_URI or S.
We should use ${BPN} or ${BP} instead to avoid breaking multilib.

[YOCTO #5427]

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/oelint.bbclass

index 07a7ed9d7c6b520e382dc6da791570a0d5ffb127..d00f468d9ab084cac3d2f659418723599fb7f795 100644 (file)
@@ -64,4 +64,22 @@ python do_lint() {
                     bb.warn("%s: %s doesn't have Signed-off-by" % (pkgname, item))
                 if findKey(path, "Upstream-Status"):
                     bb.warn("%s: %s doesn't have Upstream-Status" % (pkgname, item))
+
+
+    ##############################
+    # Check for ${PN} or ${P} usage in SRC_URI or S
+    # Should use ${BPN} or ${BP} instead to avoid breaking multilib
+    #
+    for s in srcuri:
+        if not s.startswith("file://"):
+            if not s.find("{PN}") == -1:
+                bb.warn("%s: should use BPN instead of PN in SRC_URI" % pkgname)
+            if not s.find("{P}") == -1:
+                bb.warn("%s: should use BP instead of P in SRC_URI" % pkgname)
+
+    srcpath = d.getVar("S")
+    if not srcpath.find("{PN}") == -1:
+        bb.warn("%s: should use BPN instead of PN in S" % pkgname)
+    if not srcpath.find("{P}") == -1:
+        bb.warn("%s: should use BP instead of P in S" % pkgname)
 }