diff options
Diffstat (limited to 'meta/classes/oelint.bbclass')
-rw-r--r-- | meta/classes/oelint.bbclass | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/classes/oelint.bbclass b/meta/classes/oelint.bbclass index d14e3783f3..07a7ed9d7c 100644 --- a/meta/classes/oelint.bbclass +++ b/meta/classes/oelint.bbclass | |||
@@ -29,4 +29,39 @@ python do_lint() { | |||
29 | bb.warn("%s: SECTION is not set" % pkgname) | 29 | bb.warn("%s: SECTION is not set" % pkgname) |
30 | elif not section.islower(): | 30 | elif not section.islower(): |
31 | bb.warn("%s: SECTION should only use lower case" % pkgname) | 31 | bb.warn("%s: SECTION should only use lower case" % pkgname) |
32 | |||
33 | |||
34 | ############################## | ||
35 | # Check that all patches have Signed-off-by and Upstream-Status | ||
36 | # | ||
37 | srcuri = d.getVar("SRC_URI").split() | ||
38 | fpaths = (d.getVar('FILESPATH', True) or '').split(':') | ||
39 | |||
40 | def findPatch(patchname): | ||
41 | for dir in fpaths: | ||
42 | patchpath = dir + patchname | ||
43 | if os.path.exists(patchpath): | ||
44 | return patchpath | ||
45 | |||
46 | def findKey(path, key): | ||
47 | ret = True | ||
48 | f = file('%s' % path, mode = 'r') | ||
49 | line = f.readline() | ||
50 | while line: | ||
51 | if line.find(key) != -1: | ||
52 | ret = False | ||
53 | line = f.readline() | ||
54 | f.close() | ||
55 | return ret | ||
56 | |||
57 | length = len("file://") | ||
58 | for item in srcuri: | ||
59 | if item.startswith("file://"): | ||
60 | item = item[length:] | ||
61 | if item.endswith(".patch") or item.endswith(".diff"): | ||
62 | path = findPatch(item) | ||
63 | if findKey(path, "Signed-off-by"): | ||
64 | bb.warn("%s: %s doesn't have Signed-off-by" % (pkgname, item)) | ||
65 | if findKey(path, "Upstream-Status"): | ||
66 | bb.warn("%s: %s doesn't have Upstream-Status" % (pkgname, item)) | ||
32 | } | 67 | } |