summaryrefslogtreecommitdiffstats
path: root/meta/classes/oelint.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-07-21 10:10:31 +0000
committerRichard Purdie <richard@openedhand.com>2006-07-21 10:10:31 +0000
commitb2f192faabe412adce79534e22efe9fb69ee40e2 (patch)
tree7076c49d4286f8a1733650bd8fbc7161af200d57 /meta/classes/oelint.bbclass
parent2cf0eadf9f730027833af802d7e6c90b44248f80 (diff)
downloadpoky-b2f192faabe412adce79534e22efe9fb69ee40e2.tar.gz
Rename /openembedded/ -> /meta/
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/oelint.bbclass')
-rw-r--r--meta/classes/oelint.bbclass174
1 files changed, 174 insertions, 0 deletions
diff --git a/meta/classes/oelint.bbclass b/meta/classes/oelint.bbclass
new file mode 100644
index 0000000000..baa1c630b4
--- /dev/null
+++ b/meta/classes/oelint.bbclass
@@ -0,0 +1,174 @@
1addtask lint before do_fetch
2do_lint[nostamp] = 1
3python do_lint() {
4 def testVar(var, explain=None):
5 try:
6 s = d[var]
7 return s["content"]
8 except KeyError:
9 bb.error("%s is not set" % var)
10 if explain: bb.note(explain)
11 return None
12
13
14 ##############################
15 # Test that DESCRIPTION exists
16 #
17 testVar("DESCRIPTION")
18
19
20 ##############################
21 # Test that HOMEPAGE exists
22 #
23 s = testVar("HOMEPAGE")
24 if s=="unknown":
25 bb.error("HOMEPAGE is not set")
26 elif not s.startswith("http://"):
27 bb.error("HOMEPAGE doesn't start with http://")
28
29
30
31 ##############################
32 # Test for valid LICENSE
33 #
34 valid_licenses = {
35 "GPL-2" : "GPLv2",
36 "GPL LGPL FDL" : True,
37 "GPL PSF" : True,
38 "GPL/QPL" : True,
39 "GPL" : True,
40 "GPLv2" : True,
41 "IBM" : True,
42 "LGPL GPL" : True,
43 "LGPL" : True,
44 "MIT" : True,
45 "OSL" : True,
46 "Perl" : True,
47 "Public Domain" : True,
48 "QPL" : "GPL/QPL",
49 }
50 s = testVar("LICENSE")
51 if s=="unknown":
52 bb.error("LICENSE is not set")
53 elif s.startswith("Vendor"):
54 pass
55 else:
56 try:
57 newlic = valid_licenses[s]
58 if newlic == False:
59 bb.note("LICENSE '%s' is not recommended" % s)
60 elif newlic != True:
61 bb.note("LICENSE '%s' is not recommended, better use '%s'" % (s, newsect))
62 except:
63 bb.note("LICENSE '%s' is not recommended" % s)
64
65
66 ##############################
67 # Test for valid MAINTAINER
68 #
69 s = testVar("MAINTAINER")
70 if s=="OpenEmbedded Team <oe@handhelds.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")
74
75
76 ##############################
77 # Test for valid SECTION
78 #
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
82 #
83 valid_sections = {
84 # Current Section Correct section
85 "apps" : True,
86 "audio" : True,
87 "base" : True,
88 "console/games" : True,
89 "console/net" : "console/network",
90 "console/network" : True,
91 "console/utils" : True,
92 "devel" : True,
93 "developing" : "devel",
94 "devel/python" : True,
95 "fonts" : True,
96 "games" : True,
97 "games/libs" : True,
98 "gnome/base" : True,
99 "gnome/libs" : True,
100 "gpe" : True,
101 "gpe/libs" : True,
102 "gui" : False,
103 "libc" : "libs",
104 "libs" : True,
105 "libs/net" : True,
106 "multimedia" : True,
107 "net" : "network",
108 "NET" : "network",
109 "network" : True,
110 "opie/applets" : True,
111 "opie/applications" : True,
112 "opie/base" : True,
113 "opie/codecs" : True,
114 "opie/decorations" : True,
115 "opie/fontfactories" : True,
116 "opie/fonts" : True,
117 "opie/games" : True,
118 "opie/help" : True,
119 "opie/inputmethods" : True,
120 "opie/libs" : True,
121 "opie/multimedia" : True,
122 "opie/pim" : True,
123 "opie/setting" : "opie/settings",
124 "opie/settings" : True,
125 "opie/Shell" : False,
126 "opie/styles" : True,
127 "opie/today" : True,
128 "scientific" : True,
129 "utils" : True,
130 "x11" : True,
131 "x11/libs" : True,
132 "x11/wm" : True,
133 }
134 s = testVar("SECTION")
135 if s:
136 try:
137 newsect = valid_sections[s]
138 if newsect == False:
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))
142 except:
143 bb.note("SECTION '%s' is not recommended" % s)
144
145 if not s.islower():
146 bb.error("SECTION should only use lower case")
147
148
149
150
151 ##############################
152 # Test for valid PRIORITY
153 #
154 valid_priorities = {
155 "standard" : True,
156 "required" : True,
157 "optional" : True,
158 "extra" : True,
159 }
160 s = testVar("PRIORITY")
161 if s:
162 try:
163 newprio = valid_priorities[s]
164 if newprio == False:
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))
168 except:
169 bb.note("PRIORITY '%s' is not recommended" % s)
170
171 if not s.islower():
172 bb.error("PRIORITY should only use lower case")
173
174}