]> code.ossystems Code Review - openembedded-core.git/commitdiff
util-linux: add su.1 to update-alternatives
authorRoss Burton <ross.burton@intel.com>
Tue, 1 Nov 2016 14:50:35 +0000 (14:50 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 16 Nov 2016 10:33:35 +0000 (10:33 +0000)
The su binary is handled by alternatives but the man page wasn't, so
installing both util-linux-doc and shadow-doc produces errors.

Also use d.expand() to neaten the code.

(From OE-Core rev: 70a161ee88d3d54fec6d59039c181b43f1857dc3)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/recipes-core/util-linux/util-linux.inc

index c6355021fcae1b36343faa80645636588aaed57e..70cba6b59275e20d63357fd25f41b98b51107f49 100644 (file)
@@ -271,9 +271,11 @@ BBCLASSEXTEND = "native nativesdk"
 
 python do_package_prepend () {
     if '--enable-su' in d.getVar('EXTRA_OECONF', True).split():
-        alt_name = "su"
-        d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, '%s/%s' % (d.getVar('base_bindir', True), alt_name))
-        d.appendVar('ALTERNATIVE_%s' % (d.getVar('PN', True)), ' ' + alt_name)
+        d.appendVar(d.expand('ALTERNATIVE_${PN}'), ' su')
+        d.appendVar(d.expand('ALTERNATIVE_${PN}-doc'), ' su.1')
+
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', "su", d.expand('${base_bindir}/su'))
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', "su.1", d.expand('${mandir}/man1/su.1'))
 }
 
 python populate_packages_prepend() {