summaryrefslogtreecommitdiffstats
path: root/meta/classes/update-rc.d.bbclass
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/classes/update-rc.d.bbclass
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/classes/update-rc.d.bbclass')
-rw-r--r--meta/classes/update-rc.d.bbclass36
1 files changed, 18 insertions, 18 deletions
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
index 7e4dda7cbb..492c5fba2d 100644
--- a/meta/classes/update-rc.d.bbclass
+++ b/meta/classes/update-rc.d.bbclass
@@ -30,11 +30,11 @@ update-rc.d $D ${INITSCRIPT_NAME} remove
30 30
31 31
32def update_rc_after_parse(d): 32def update_rc_after_parse(d):
33 if bb.data.getVar('INITSCRIPT_PACKAGES', d) == None: 33 if d.getVar('INITSCRIPT_PACKAGES') == None:
34 if bb.data.getVar('INITSCRIPT_NAME', d) == None: 34 if d.getVar('INITSCRIPT_NAME') == None:
35 raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % bb.data.getVar('FILE', d) 35 raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE')
36 if bb.data.getVar('INITSCRIPT_PARAMS', d) == None: 36 if d.getVar('INITSCRIPT_PARAMS') == None:
37 raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % bb.data.getVar('FILE', d) 37 raise bb.build.FuncFailed, "%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE')
38 38
39python __anonymous() { 39python __anonymous() {
40 update_rc_after_parse(d) 40 update_rc_after_parse(d)
@@ -44,7 +44,7 @@ python populate_packages_prepend () {
44 def update_rcd_package(pkg): 44 def update_rcd_package(pkg):
45 bb.debug(1, 'adding update-rc.d calls to postinst/postrm for %s' % pkg) 45 bb.debug(1, 'adding update-rc.d calls to postinst/postrm for %s' % pkg)
46 localdata = bb.data.createCopy(d) 46 localdata = bb.data.createCopy(d)
47 overrides = bb.data.getVar("OVERRIDES", localdata, 1) 47 overrides = localdata.getVar("OVERRIDES", 1)
48 bb.data.setVar("OVERRIDES", "%s:%s" % (pkg, overrides), localdata) 48 bb.data.setVar("OVERRIDES", "%s:%s" % (pkg, overrides), localdata)
49 bb.data.update_data(localdata) 49 bb.data.update_data(localdata)
50 50
@@ -53,28 +53,28 @@ python populate_packages_prepend () {
53 execute on the target. Not doing so may cause update_rc.d postinst invoked 53 execute on the target. Not doing so may cause update_rc.d postinst invoked
54 twice to cause unwanted warnings. 54 twice to cause unwanted warnings.
55 """ 55 """
56 postinst = bb.data.getVar('pkg_postinst', localdata, 1) 56 postinst = localdata.getVar('pkg_postinst', 1)
57 if not postinst: 57 if not postinst:
58 postinst = '#!/bin/sh\n' 58 postinst = '#!/bin/sh\n'
59 postinst += bb.data.getVar('updatercd_postinst', localdata, 1) 59 postinst += localdata.getVar('updatercd_postinst', 1)
60 bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) 60 d.setVar('pkg_postinst_%s' % pkg, postinst)
61 61
62 prerm = bb.data.getVar('pkg_prerm', localdata, 1) 62 prerm = localdata.getVar('pkg_prerm', 1)
63 if not prerm: 63 if not prerm:
64 prerm = '#!/bin/sh\n' 64 prerm = '#!/bin/sh\n'
65 prerm += bb.data.getVar('updatercd_prerm', localdata, 1) 65 prerm += localdata.getVar('updatercd_prerm', 1)
66 bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d) 66 d.setVar('pkg_prerm_%s' % pkg, prerm)
67 67
68 postrm = bb.data.getVar('pkg_postrm', localdata, 1) 68 postrm = localdata.getVar('pkg_postrm', 1)
69 if not postrm: 69 if not postrm:
70 postrm = '#!/bin/sh\n' 70 postrm = '#!/bin/sh\n'
71 postrm += bb.data.getVar('updatercd_postrm', localdata, 1) 71 postrm += localdata.getVar('updatercd_postrm', 1)
72 bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) 72 d.setVar('pkg_postrm_%s' % pkg, postrm)
73 73
74 pkgs = bb.data.getVar('INITSCRIPT_PACKAGES', d, 1) 74 pkgs = d.getVar('INITSCRIPT_PACKAGES', 1)
75 if pkgs == None: 75 if pkgs == None:
76 pkgs = bb.data.getVar('UPDATERCPN', d, 1) 76 pkgs = d.getVar('UPDATERCPN', 1)
77 packages = (bb.data.getVar('PACKAGES', d, 1) or "").split() 77 packages = (d.getVar('PACKAGES', 1) or "").split()
78 if not pkgs in packages and packages != []: 78 if not pkgs in packages and packages != []:
79 pkgs = packages[0] 79 pkgs = packages[0]
80 for pkg in pkgs.split(): 80 for pkg in pkgs.split():