mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
update-rc.d: Drop OVERRIDES code
The data store copy and overrides is overkill given the small number of accesses that are being made. This simplifies the code. (From OE-Core rev: 72c1fd72d3b479c728e249eaa763116d352e945b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -50,32 +50,27 @@ python __anonymous() {
|
|||||||
python populate_packages_prepend () {
|
python populate_packages_prepend () {
|
||||||
def update_rcd_package(pkg):
|
def update_rcd_package(pkg):
|
||||||
bb.debug(1, 'adding update-rc.d calls to postinst/postrm for %s' % pkg)
|
bb.debug(1, 'adding update-rc.d calls to postinst/postrm for %s' % pkg)
|
||||||
localdata = bb.data.createCopy(d)
|
|
||||||
overrides = localdata.getVar("OVERRIDES", True)
|
|
||||||
localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides))
|
|
||||||
bb.data.update_data(localdata)
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
update_rc.d postinst is appended here because pkg_postinst may require to
|
update_rc.d postinst is appended here because pkg_postinst may require to
|
||||||
execute on the target. Not doing so may cause update_rc.d postinst invoked
|
execute on the target. Not doing so may cause update_rc.d postinst invoked
|
||||||
twice to cause unwanted warnings.
|
twice to cause unwanted warnings.
|
||||||
"""
|
"""
|
||||||
postinst = localdata.getVar('pkg_postinst', True)
|
postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
|
||||||
if not postinst:
|
if not postinst:
|
||||||
postinst = '#!/bin/sh\n'
|
postinst = '#!/bin/sh\n'
|
||||||
postinst += localdata.getVar('updatercd_postinst', True)
|
postinst += d.getVar('updatercd_postinst', True)
|
||||||
d.setVar('pkg_postinst_%s' % pkg, postinst)
|
d.setVar('pkg_postinst_%s' % pkg, postinst)
|
||||||
|
|
||||||
prerm = localdata.getVar('pkg_prerm', True)
|
prerm = d.getVar('pkg_prerm_%s' % pkg, True) or d.getVar('pkg_prerm', True)
|
||||||
if not prerm:
|
if not prerm:
|
||||||
prerm = '#!/bin/sh\n'
|
prerm = '#!/bin/sh\n'
|
||||||
prerm += localdata.getVar('updatercd_prerm', True)
|
prerm += d.getVar('updatercd_prerm', True)
|
||||||
d.setVar('pkg_prerm_%s' % pkg, prerm)
|
d.setVar('pkg_prerm_%s' % pkg, prerm)
|
||||||
|
|
||||||
postrm = localdata.getVar('pkg_postrm', True)
|
postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
|
||||||
if not postrm:
|
if not postrm:
|
||||||
postrm = '#!/bin/sh\n'
|
postrm = '#!/bin/sh\n'
|
||||||
postrm += localdata.getVar('updatercd_postrm', True)
|
postrm += d.getVar('updatercd_postrm', True)
|
||||||
d.setVar('pkg_postrm_%s' % pkg, postrm)
|
d.setVar('pkg_postrm_%s' % pkg, postrm)
|
||||||
|
|
||||||
pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
|
pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
|
||||||
|
|||||||
Reference in New Issue
Block a user