diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2015-03-18 22:33:01 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-22 14:42:15 +0000 |
| commit | 5dc1f3d8a0b7394398f9a090890e6af41a5e39dc (patch) | |
| tree | d62310fa6aea7e92855e497465428b52954d89e4 | |
| parent | 7366894e41139ed9e5d6c70c5f0ba4c52a2dc239 (diff) | |
| download | poky-5dc1f3d8a0b7394398f9a090890e6af41a5e39dc.tar.gz | |
oelint.bbclass: remove duplicated code
The old code 'if not srcpath.find("{PN}") == -1:' looks strange, use
'if srcpath.find("{PN}") != -1:' and remove duplicated code.
(From OE-Core rev: bb3b8e4e7580c1dfdfe584d3b5f0fe6803826a43)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/oelint.bbclass | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/meta/classes/oelint.bbclass b/meta/classes/oelint.bbclass index 1cee4b0f25..3e01503756 100644 --- a/meta/classes/oelint.bbclass +++ b/meta/classes/oelint.bbclass | |||
| @@ -54,6 +54,12 @@ python do_lint() { | |||
| 54 | f.close() | 54 | f.close() |
| 55 | return ret | 55 | return ret |
| 56 | 56 | ||
| 57 | def checkPN(pkgname, varname, str): | ||
| 58 | if str.find("{PN}") != -1: | ||
| 59 | bb.warn("%s: should use BPN instead of PN in %s" % (pkgname, varname)) | ||
| 60 | if str.find("{P}") != -1: | ||
| 61 | bb.warn("%s: should use BP instead of P in %s" % (pkgname, varname)) | ||
| 62 | |||
| 57 | length = len("file://") | 63 | length = len("file://") |
| 58 | for item in srcuri: | 64 | for item in srcuri: |
| 59 | if item.startswith("file://"): | 65 | if item.startswith("file://"): |
| @@ -72,14 +78,7 @@ python do_lint() { | |||
| 72 | # | 78 | # |
| 73 | for s in srcuri: | 79 | for s in srcuri: |
| 74 | if not s.startswith("file://"): | 80 | if not s.startswith("file://"): |
| 75 | if not s.find("{PN}") == -1: | 81 | checkPN(pkgname, 'SRC_URI', s) |
| 76 | bb.warn("%s: should use BPN instead of PN in SRC_URI" % pkgname) | ||
| 77 | if not s.find("{P}") == -1: | ||
| 78 | bb.warn("%s: should use BP instead of P in SRC_URI" % pkgname) | ||
| 79 | 82 | ||
| 80 | srcpath = d.getVar("S") | 83 | checkPN(pkgname, 'S', d.getVar('S')) |
| 81 | if not srcpath.find("{PN}") == -1: | ||
| 82 | bb.warn("%s: should use BPN instead of PN in S" % pkgname) | ||
| 83 | if not srcpath.find("{P}") == -1: | ||
| 84 | bb.warn("%s: should use BP instead of P in S" % pkgname) | ||
| 85 | } | 84 | } |
