summaryrefslogtreecommitdiffstats
path: root/meta/classes/recipe_sanity.bbclass
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-12-14 21:13:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-16 10:23:23 +0000
commitc4e2c59088765d1f1de7ec57cde91980f887c2ff (patch)
treea2fda8ac5916fb59a711e9220c2177008cca9347 /meta/classes/recipe_sanity.bbclass
parentd5e67725ac11e3296cad104470931ffa16824b90 (diff)
downloadpoky-c4e2c59088765d1f1de7ec57cde91980f887c2ff.tar.gz
meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/recipe_sanity.bbclass')
-rw-r--r--meta/classes/recipe_sanity.bbclass26
1 files changed, 13 insertions, 13 deletions
diff --git a/meta/classes/recipe_sanity.bbclass b/meta/classes/recipe_sanity.bbclass
index add34df9d6..3b00b0e521 100644
--- a/meta/classes/recipe_sanity.bbclass
+++ b/meta/classes/recipe_sanity.bbclass
@@ -1,5 +1,5 @@
1def __note(msg, d): 1def __note(msg, d):
2 bb.note("%s: recipe_sanity: %s" % (d.getVar("P", True), msg)) 2 bb.note("%s: recipe_sanity: %s" % (d.getVar("P"), msg))
3 3
4__recipe_sanity_badruntimevars = "RDEPENDS RPROVIDES RRECOMMENDS RCONFLICTS" 4__recipe_sanity_badruntimevars = "RDEPENDS RPROVIDES RRECOMMENDS RCONFLICTS"
5def bad_runtime_vars(cfgdata, d): 5def bad_runtime_vars(cfgdata, d):
@@ -7,7 +7,7 @@ def bad_runtime_vars(cfgdata, d):
7 bb.data.inherits_class("cross", d): 7 bb.data.inherits_class("cross", d):
8 return 8 return
9 9
10 for var in d.getVar("__recipe_sanity_badruntimevars", True).split(): 10 for var in d.getVar("__recipe_sanity_badruntimevars").split():
11 val = d.getVar(var, False) 11 val = d.getVar(var, False)
12 if val and val != cfgdata.get(var): 12 if val and val != cfgdata.get(var):
13 __note("%s should be %s_${PN}" % (var, var), d) 13 __note("%s should be %s_${PN}" % (var, var), d)
@@ -15,11 +15,11 @@ def bad_runtime_vars(cfgdata, d):
15__recipe_sanity_reqvars = "DESCRIPTION" 15__recipe_sanity_reqvars = "DESCRIPTION"
16__recipe_sanity_reqdiffvars = "" 16__recipe_sanity_reqdiffvars = ""
17def req_vars(cfgdata, d): 17def req_vars(cfgdata, d):
18 for var in d.getVar("__recipe_sanity_reqvars", True).split(): 18 for var in d.getVar("__recipe_sanity_reqvars").split():
19 if not d.getVar(var, False): 19 if not d.getVar(var, False):
20 __note("%s should be set" % var, d) 20 __note("%s should be set" % var, d)
21 21
22 for var in d.getVar("__recipe_sanity_reqdiffvars", True).split(): 22 for var in d.getVar("__recipe_sanity_reqdiffvars").split():
23 val = d.getVar(var, False) 23 val = d.getVar(var, False)
24 cfgval = cfgdata.get(var) 24 cfgval = cfgdata.get(var)
25 25
@@ -38,11 +38,11 @@ def var_renames_overwrite(cfgdata, d):
38def incorrect_nonempty_PACKAGES(cfgdata, d): 38def incorrect_nonempty_PACKAGES(cfgdata, d):
39 if bb.data.inherits_class("native", d) or \ 39 if bb.data.inherits_class("native", d) or \
40 bb.data.inherits_class("cross", d): 40 bb.data.inherits_class("cross", d):
41 if d.getVar("PACKAGES", True): 41 if d.getVar("PACKAGES"):
42 return True 42 return True
43 43
44def can_use_autotools_base(cfgdata, d): 44def can_use_autotools_base(cfgdata, d):
45 cfg = d.getVar("do_configure", True) 45 cfg = d.getVar("do_configure")
46 if not bb.data.inherits_class("autotools", d): 46 if not bb.data.inherits_class("autotools", d):
47 return False 47 return False
48 48
@@ -61,7 +61,7 @@ def can_delete_FILESPATH(cfgdata, d):
61 expected = cfgdata.get("FILESPATH") 61 expected = cfgdata.get("FILESPATH")
62 expectedpaths = d.expand(expected) 62 expectedpaths = d.expand(expected)
63 unexpanded = d.getVar("FILESPATH", False) 63 unexpanded = d.getVar("FILESPATH", False)
64 filespath = d.getVar("FILESPATH", True).split(":") 64 filespath = d.getVar("FILESPATH").split(":")
65 filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)] 65 filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)]
66 for fp in filespath: 66 for fp in filespath:
67 if not fp in expectedpaths: 67 if not fp in expectedpaths:
@@ -72,13 +72,13 @@ def can_delete_FILESPATH(cfgdata, d):
72 72
73def can_delete_FILESDIR(cfgdata, d): 73def can_delete_FILESDIR(cfgdata, d):
74 expected = cfgdata.get("FILESDIR") 74 expected = cfgdata.get("FILESDIR")
75 #expected = "${@bb.utils.which(d.getVar('FILESPATH', True), '.')}" 75 #expected = "${@bb.utils.which(d.getVar('FILESPATH'), '.')}"
76 unexpanded = d.getVar("FILESDIR", False) 76 unexpanded = d.getVar("FILESDIR", False)
77 if unexpanded is None: 77 if unexpanded is None:
78 return False 78 return False
79 79
80 expanded = os.path.normpath(d.getVar("FILESDIR", True)) 80 expanded = os.path.normpath(d.getVar("FILESDIR"))
81 filespath = d.getVar("FILESPATH", True).split(":") 81 filespath = d.getVar("FILESPATH").split(":")
82 filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)] 82 filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)]
83 83
84 return unexpanded != expected and \ 84 return unexpanded != expected and \
@@ -96,7 +96,7 @@ def can_delete_others(p, cfgdata, d):
96 continue 96 continue
97 97
98 try: 98 try:
99 expanded = d.getVar(k, True) 99 expanded = d.getVar(k)
100 cfgexpanded = d.expand(cfgunexpanded) 100 cfgexpanded = d.expand(cfgunexpanded)
101 except bb.fetch.ParameterError: 101 except bb.fetch.ParameterError:
102 continue 102 continue
@@ -108,8 +108,8 @@ def can_delete_others(p, cfgdata, d):
108 (p, cfgunexpanded, unexpanded, expanded)) 108 (p, cfgunexpanded, unexpanded, expanded))
109 109
110python do_recipe_sanity () { 110python do_recipe_sanity () {
111 p = d.getVar("P", True) 111 p = d.getVar("P")
112 p = "%s %s %s" % (d.getVar("PN", True), d.getVar("PV", True), d.getVar("PR", True)) 112 p = "%s %s %s" % (d.getVar("PN"), d.getVar("PV"), d.getVar("PR"))
113 113
114 sanitychecks = [ 114 sanitychecks = [
115 (can_delete_FILESDIR, "candidate for removal of FILESDIR"), 115 (can_delete_FILESDIR, "candidate for removal of FILESDIR"),