summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-09 15:00:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-10 11:51:19 +0000
commitc8dee9b92dfd545852ecac8dc2adfc95ac02e957 (patch)
tree5f1b86954646a0f3bb914407994388a6a4346769 /meta/lib/oe
parent5d3860f4a8abb8e95442b04f8b84a333af362fcd (diff)
downloadpoky-c8dee9b92dfd545852ecac8dc2adfc95ac02e957.tar.gz
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata: sed \ -e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \ -e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` (From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/distro_check.py22
-rw-r--r--meta/lib/oe/patch.py4
-rw-r--r--meta/lib/oe/utils.py8
3 files changed, 17 insertions, 17 deletions
diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py
index 4721355bd8..ad391e3b01 100644
--- a/meta/lib/oe/distro_check.py
+++ b/meta/lib/oe/distro_check.py
@@ -276,32 +276,32 @@ def compare_in_distro_packages_list(distro_check_dir, d):
276 localdata = bb.data.createCopy(d) 276 localdata = bb.data.createCopy(d)
277 pkglst_dir = os.path.join(distro_check_dir, "package_lists") 277 pkglst_dir = os.path.join(distro_check_dir, "package_lists")
278 matching_distros = [] 278 matching_distros = []
279 pn = bb.data.getVar('PN', d, True) 279 pn = d.getVar('PN', True)
280 recipe_name = bb.data.getVar('PN', d, True) 280 recipe_name = d.getVar('PN', True)
281 bb.note("Checking: %s" % pn) 281 bb.note("Checking: %s" % pn)
282 282
283 trim_dict = dict({"-native":"-native", "-cross":"-cross", "-initial":"-initial"}) 283 trim_dict = dict({"-native":"-native", "-cross":"-cross", "-initial":"-initial"})
284 284
285 if pn.find("-native") != -1: 285 if pn.find("-native") != -1:
286 pnstripped = pn.split("-native") 286 pnstripped = pn.split("-native")
287 bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) 287 bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata)
288 bb.data.update_data(localdata) 288 bb.data.update_data(localdata)
289 recipe_name = pnstripped[0] 289 recipe_name = pnstripped[0]
290 290
291 if pn.find("-cross") != -1: 291 if pn.find("-cross") != -1:
292 pnstripped = pn.split("-cross") 292 pnstripped = pn.split("-cross")
293 bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) 293 bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata)
294 bb.data.update_data(localdata) 294 bb.data.update_data(localdata)
295 recipe_name = pnstripped[0] 295 recipe_name = pnstripped[0]
296 296
297 if pn.find("-initial") != -1: 297 if pn.find("-initial") != -1:
298 pnstripped = pn.split("-initial") 298 pnstripped = pn.split("-initial")
299 bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + bb.data.getVar('OVERRIDES', d, True), localdata) 299 bb.data.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True), localdata)
300 bb.data.update_data(localdata) 300 bb.data.update_data(localdata)
301 recipe_name = pnstripped[0] 301 recipe_name = pnstripped[0]
302 302
303 bb.note("Recipe: %s" % recipe_name) 303 bb.note("Recipe: %s" % recipe_name)
304 tmp = bb.data.getVar('DISTRO_PN_ALIAS', localdata, True) 304 tmp = localdata.getVar('DISTRO_PN_ALIAS', True)
305 305
306 distro_exceptions = dict({"OE-Core":'OE-Core', "OpenedHand":'OpenedHand', "Intel":'Intel', "Upstream":'Upstream', "Windriver":'Windriver', "OSPDT":'OSPDT Approved', "Poky":'poky'}) 306 distro_exceptions = dict({"OE-Core":'OE-Core', "OpenedHand":'OpenedHand', "Intel":'Intel', "Upstream":'Upstream', "Windriver":'Windriver', "OSPDT":'OSPDT Approved', "Poky":'poky'})
307 307
@@ -343,23 +343,23 @@ def compare_in_distro_packages_list(distro_check_dir, d):
343 return matching_distros 343 return matching_distros
344 344
345def create_log_file(d, logname): 345def create_log_file(d, logname):
346 logpath = bb.data.getVar('LOG_DIR', d, True) 346 logpath = d.getVar('LOG_DIR', True)
347 bb.utils.mkdirhier(logpath) 347 bb.utils.mkdirhier(logpath)
348 logfn, logsuffix = os.path.splitext(logname) 348 logfn, logsuffix = os.path.splitext(logname)
349 logfile = os.path.join(logpath, "%s.%s%s" % (logfn, bb.data.getVar('DATETIME', d, True), logsuffix)) 349 logfile = os.path.join(logpath, "%s.%s%s" % (logfn, d.getVar('DATETIME', True), logsuffix))
350 if not os.path.exists(logfile): 350 if not os.path.exists(logfile):
351 slogfile = os.path.join(logpath, logname) 351 slogfile = os.path.join(logpath, logname)
352 if os.path.exists(slogfile): 352 if os.path.exists(slogfile):
353 os.remove(slogfile) 353 os.remove(slogfile)
354 os.system("touch %s" % logfile) 354 os.system("touch %s" % logfile)
355 os.symlink(logfile, slogfile) 355 os.symlink(logfile, slogfile)
356 bb.data.setVar('LOG_FILE', logfile, d) 356 d.setVar('LOG_FILE', logfile)
357 return logfile 357 return logfile
358 358
359 359
360def save_distro_check_result(result, datetime, result_file, d): 360def save_distro_check_result(result, datetime, result_file, d):
361 pn = bb.data.getVar('PN', d, True) 361 pn = d.getVar('PN', True)
362 logdir = bb.data.getVar('LOG_DIR', d, True) 362 logdir = d.getVar('LOG_DIR', True)
363 if not logdir: 363 if not logdir:
364 bb.error("LOG_DIR variable is not defined, can't write the distro_check results") 364 bb.error("LOG_DIR variable is not defined, can't write the distro_check results")
365 return 365 return
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 75fb91e0fb..f4ccb3e183 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -179,7 +179,7 @@ class GitApplyTree(PatchTree):
179 179
180class QuiltTree(PatchSet): 180class QuiltTree(PatchSet):
181 def _runcmd(self, args, run = True): 181 def _runcmd(self, args, run = True):
182 quiltrc = bb.data.getVar('QUILTRCFILE', self.d, 1) 182 quiltrc = self.d.getVar('QUILTRCFILE', 1)
183 if not run: 183 if not run:
184 return ["quilt"] + ["--quiltrc"] + [quiltrc] + args 184 return ["quilt"] + ["--quiltrc"] + [quiltrc] + args
185 runcmd(["quilt"] + ["--quiltrc"] + [quiltrc] + args, self.dir) 185 runcmd(["quilt"] + ["--quiltrc"] + [quiltrc] + args, self.dir)
@@ -357,7 +357,7 @@ class UserResolver(Resolver):
357 # Patch application failed 357 # Patch application failed
358 patchcmd = self.patchset.Push(True, False, False) 358 patchcmd = self.patchset.Push(True, False, False)
359 359
360 t = bb.data.getVar('T', self.patchset.d, 1) 360 t = self.patchset.d.getVar('T', 1)
361 if not t: 361 if not t:
362 bb.msg.fatal("Build", "T not set") 362 bb.msg.fatal("Build", "T not set")
363 bb.utils.mkdirhier(t) 363 bb.utils.mkdirhier(t)
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index b3473d3476..95daace6c6 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -16,19 +16,19 @@ def ifelse(condition, iftrue = True, iffalse = False):
16 return iffalse 16 return iffalse
17 17
18def conditional(variable, checkvalue, truevalue, falsevalue, d): 18def conditional(variable, checkvalue, truevalue, falsevalue, d):
19 if bb.data.getVar(variable,d,1) == checkvalue: 19 if d.getVar(variable,1) == checkvalue:
20 return truevalue 20 return truevalue
21 else: 21 else:
22 return falsevalue 22 return falsevalue
23 23
24def less_or_equal(variable, checkvalue, truevalue, falsevalue, d): 24def less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
25 if float(bb.data.getVar(variable,d,1)) <= float(checkvalue): 25 if float(d.getVar(variable,1)) <= float(checkvalue):
26 return truevalue 26 return truevalue
27 else: 27 else:
28 return falsevalue 28 return falsevalue
29 29
30def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d): 30def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
31 result = bb.vercmp(bb.data.getVar(variable,d,True), checkvalue) 31 result = bb.vercmp(d.getVar(variable,True), checkvalue)
32 if result <= 0: 32 if result <= 0:
33 return truevalue 33 return truevalue
34 else: 34 else:
@@ -48,7 +48,7 @@ def contains(variable, checkvalues, truevalue, falsevalue, d):
48 return falsevalue 48 return falsevalue
49 49
50def both_contain(variable1, variable2, checkvalue, d): 50def both_contain(variable1, variable2, checkvalue, d):
51 if bb.data.getVar(variable1,d,1).find(checkvalue) != -1 and bb.data.getVar(variable2,d,1).find(checkvalue) != -1: 51 if d.getVar(variable1,1).find(checkvalue) != -1 and d.getVar(variable2,1).find(checkvalue) != -1:
52 return checkvalue 52 return checkvalue
53 else: 53 else:
54 return "" 54 return ""