summaryrefslogtreecommitdiffstats
path: root/meta-systemd
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-10-28 13:49:59 +0000
committerPaul Eggleton <paul.eggleton@linux.intel.com>2012-10-28 14:32:06 +0000
commit3a30c562385cb3d9cd1b3043f6fe677a22024018 (patch)
tree66dc67f338ba316c25ca672950ef334e9e357386 /meta-systemd
parentd66c9a8b625f7b19f7b17e728dc82413399c2e19 (diff)
downloadmeta-openembedded-3a30c562385cb3d9cd1b3043f6fe677a22024018.tar.gz
Replace bb.data.* with d.*
Used sed expression given here: http://lists.linuxtogo.org/pipermail/openembedded-core/2011-November/012373.html Plus an additional expression for .expand. Full expression is: 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' \ -e 's:bb.data.\(expand([^,]*\), \([^ )]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` Some minor correction in systemd.bbclass was needed for some expressions that didn't quite match the regex in the desired way; additionally a few instances were manually changed. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta-systemd')
-rw-r--r--meta-systemd/classes/systemd.bbclass28
1 files changed, 14 insertions, 14 deletions
diff --git a/meta-systemd/classes/systemd.bbclass b/meta-systemd/classes/systemd.bbclass
index 96d7f8f55..f26c6d1c1 100644
--- a/meta-systemd/classes/systemd.bbclass
+++ b/meta-systemd/classes/systemd.bbclass
@@ -29,9 +29,9 @@ systemctl disable ${SYSTEMD_SERVICE}
29} 29}
30 30
31def get_package_var(d, var, pkg): 31def get_package_var(d, var, pkg):
32 val = (d.getVar('%s_%s' % (var, pkg), d, 1) or "").strip() 32 val = (d.getVar('%s_%s' % (var, pkg), 1) or "").strip()
33 if val == "": 33 if val == "":
34 val = (d.getVar(var, d, 1) or "").strip() 34 val = (d.getVar(var, 1) or "").strip()
35 return val 35 return val
36 36
37def systemd_after_parse(d): 37def systemd_after_parse(d):
@@ -94,9 +94,9 @@ do_install_append() {
94python populate_packages_prepend () { 94python populate_packages_prepend () {
95 def systemd_generate_package_scripts(pkg): 95 def systemd_generate_package_scripts(pkg):
96 bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg) 96 bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg)
97 localdata = bb.data.createCopy(d) 97 localdata = d.createCopy()
98 overrides = bb.data.getVar("OVERRIDES", localdata, 1) 98 overrides = localdata.getVar("OVERRIDES", 1)
99 bb.data.setVar("OVERRIDES", "%s:%s" % (pkg, overrides), localdata) 99 localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides))
100 bb.data.update_data(localdata) 100 bb.data.update_data(localdata)
101 101
102 """ 102 """
@@ -104,23 +104,23 @@ python populate_packages_prepend () {
104 execute on the target. Not doing so may cause systemd postinst invoked 104 execute on the target. Not doing so may cause systemd postinst invoked
105 twice to cause unwanted warnings. 105 twice to cause unwanted warnings.
106 """ 106 """
107 postinst = bb.data.getVar('pkg_postinst', localdata, 1) 107 postinst = localdata.getVar('pkg_postinst', 1)
108 if not postinst: 108 if not postinst:
109 postinst = '#!/bin/sh\n' 109 postinst = '#!/bin/sh\n'
110 postinst += bb.data.getVar('systemd_postinst', localdata, 1) 110 postinst += localdata.getVar('systemd_postinst', 1)
111 bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) 111 d.setVar('pkg_postinst_%s' % pkg, postinst)
112 112
113 prerm = bb.data.getVar('pkg_prerm', localdata, 1) 113 prerm = localdata.getVar('pkg_prerm', 1)
114 if not prerm: 114 if not prerm:
115 prerm = '#!/bin/sh\n' 115 prerm = '#!/bin/sh\n'
116 prerm += bb.data.getVar('systemd_prerm', localdata, 1) 116 prerm += localdata.getVar('systemd_prerm', 1)
117 bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d) 117 d.setVar('pkg_prerm_%s' % pkg, prerm)
118 118
119 postrm = bb.data.getVar('pkg_postrm', localdata, 1) 119 postrm = localdata.getVar('pkg_postrm', 1)
120 if not postrm: 120 if not postrm:
121 postrm = '#!/bin/sh\n' 121 postrm = '#!/bin/sh\n'
122 postrm += bb.data.getVar('systemd_postrm', localdata, 1) 122 postrm += localdata.getVar('systemd_postrm', 1)
123 bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) 123 d.setVar('pkg_postrm_%s' % pkg, postrm)
124 124
125 # add files to FILES_*-systemd if existent and not already done 125 # add files to FILES_*-systemd if existent and not already done
126 def systemd_append_file(pkg_systemd, file_append): 126 def systemd_append_file(pkg_systemd, file_append):