update-alternatives.bbclass: refuse to manage SysV init scripts

Sanity check for future packages.

[YOCTO #10944]

(From OE-Core rev: 6cfdca2331228667aecf6228271eea1c9835e5a5)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
(cherry picked from commit 061fa614cec49deb0374ccadf3013e5cc8ad2c51)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Markus Lehtonen
2016-12-05 13:35:16 +02:00
committed by Richard Purdie
parent adbe66ba51
commit 187af6b064

View File

@@ -143,6 +143,10 @@ python perform_packagecopy_append () {
if not alt_link:
alt_link = "%s/%s" % (d.getVar('bindir'), alt_name)
d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link)
if alt_link.startswith(os.path.join(d.getVar('sysconfdir', True), 'init.d')):
# Managing init scripts does not work (bug #10433), foremost
# because of a race with update-rc.d
bb.fatal("Using update-alternatives for managing SysV init scripts is not supported")
alt_target = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name)
alt_target = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg) or d.getVar('ALTERNATIVE_TARGET') or alt_link