diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-10-28 13:49:59 +0000 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-10-28 14:32:06 +0000 |
commit | 3a30c562385cb3d9cd1b3043f6fe677a22024018 (patch) | |
tree | 66dc67f338ba316c25ca672950ef334e9e357386 /meta-systemd | |
parent | d66c9a8b625f7b19f7b17e728dc82413399c2e19 (diff) | |
download | meta-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.bbclass | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/meta-systemd/classes/systemd.bbclass b/meta-systemd/classes/systemd.bbclass index 96d7f8f559..f26c6d1c1c 100644 --- a/meta-systemd/classes/systemd.bbclass +++ b/meta-systemd/classes/systemd.bbclass @@ -29,9 +29,9 @@ systemctl disable ${SYSTEMD_SERVICE} } def get_package_var(d, var, pkg): - val = (d.getVar('%s_%s' % (var, pkg), d, 1) or "").strip() + val = (d.getVar('%s_%s' % (var, pkg), 1) or "").strip() if val == "": - val = (d.getVar(var, d, 1) or "").strip() + val = (d.getVar(var, 1) or "").strip() return val def systemd_after_parse(d): @@ -94,9 +94,9 @@ do_install_append() { python populate_packages_prepend () { def systemd_generate_package_scripts(pkg): bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg) - localdata = bb.data.createCopy(d) - overrides = bb.data.getVar("OVERRIDES", localdata, 1) - bb.data.setVar("OVERRIDES", "%s:%s" % (pkg, overrides), localdata) + localdata = d.createCopy() + overrides = localdata.getVar("OVERRIDES", 1) + localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides)) bb.data.update_data(localdata) """ @@ -104,23 +104,23 @@ python populate_packages_prepend () { execute on the target. Not doing so may cause systemd postinst invoked twice to cause unwanted warnings. """ - postinst = bb.data.getVar('pkg_postinst', localdata, 1) + postinst = localdata.getVar('pkg_postinst', 1) if not postinst: postinst = '#!/bin/sh\n' - postinst += bb.data.getVar('systemd_postinst', localdata, 1) - bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) + postinst += localdata.getVar('systemd_postinst', 1) + d.setVar('pkg_postinst_%s' % pkg, postinst) - prerm = bb.data.getVar('pkg_prerm', localdata, 1) + prerm = localdata.getVar('pkg_prerm', 1) if not prerm: prerm = '#!/bin/sh\n' - prerm += bb.data.getVar('systemd_prerm', localdata, 1) - bb.data.setVar('pkg_prerm_%s' % pkg, prerm, d) + prerm += localdata.getVar('systemd_prerm', 1) + d.setVar('pkg_prerm_%s' % pkg, prerm) - postrm = bb.data.getVar('pkg_postrm', localdata, 1) + postrm = localdata.getVar('pkg_postrm', 1) if not postrm: postrm = '#!/bin/sh\n' - postrm += bb.data.getVar('systemd_postrm', localdata, 1) - bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) + postrm += localdata.getVar('systemd_postrm', 1) + d.setVar('pkg_postrm_%s' % pkg, postrm) # add files to FILES_*-systemd if existent and not already done def systemd_append_file(pkg_systemd, file_append): |