1 addtask lint before do_fetch
4 def testVar(var, explain=None):
9 bb.error("%s is not set" % var)
10 if explain: bb.note(explain)
14 ##############################
15 # Test that DESCRIPTION exists
17 testVar("DESCRIPTION")
20 ##############################
21 # Test that HOMEPAGE exists
23 s = testVar("HOMEPAGE")
25 bb.error("HOMEPAGE is not set")
26 elif not s.startswith("http://"):
27 bb.error("HOMEPAGE doesn't start with http://")
31 ##############################
32 # Test for valid LICENSE
36 "GPL LGPL FDL" : True,
47 "Public Domain" : True,
50 s = testVar("LICENSE")
52 bb.error("LICENSE is not set")
53 elif s.startswith("Vendor"):
57 newlic = valid_licenses[s]
59 bb.note("LICENSE '%s' is not recommended" % s)
61 bb.note("LICENSE '%s' is not recommended, better use '%s'" % (s, newsect))
63 bb.note("LICENSE '%s' is not recommended" % s)
66 ##############################
67 # Test for valid MAINTAINER
69 s = testVar("MAINTAINER")
70 if s=="OpenEmbedded Team <openembedded-devel@openembedded.org>":
71 bb.error("explicit MAINTAINER is missing, using default")
72 elif s and s.find("@") == -1:
73 bb.error("You forgot to put an e-mail address into MAINTAINER")
76 ##############################
77 # Test for valid SECTION
79 # if Correct section: True section name is valid
80 # False section name is invalid, no suggestion
81 # string section name is invalid, better name suggested
84 # Current Section Correct section
88 "console/games" : True,
89 "console/net" : "console/network",
90 "console/network" : True,
91 "console/utils" : True,
93 "developing" : "devel",
94 "devel/python" : True,
110 "opie/applets" : True,
111 "opie/applications" : True,
113 "opie/codecs" : True,
114 "opie/decorations" : True,
115 "opie/fontfactories" : True,
119 "opie/inputmethods" : True,
121 "opie/multimedia" : True,
123 "opie/setting" : "opie/settings",
124 "opie/settings" : True,
125 "opie/Shell" : False,
126 "opie/styles" : True,
134 s = testVar("SECTION")
137 newsect = valid_sections[s]
139 bb.note("SECTION '%s' is not recommended" % s)
140 elif newsect != True:
141 bb.note("SECTION '%s' is not recommended, better use '%s'" % (s, newsect))
143 bb.note("SECTION '%s' is not recommended" % s)
146 bb.error("SECTION should only use lower case")
151 ##############################
152 # Test for valid PRIORITY
160 s = testVar("PRIORITY")
163 newprio = valid_priorities[s]
165 bb.note("PRIORITY '%s' is not recommended" % s)
166 elif newprio != True:
167 bb.note("PRIORITY '%s' is not recommended, better use '%s'" % (s, newprio))
169 bb.note("PRIORITY '%s' is not recommended" % s)
172 bb.error("PRIORITY should only use lower case")