Skip to contentSkip to conversation

util-linux: add su.1 to update-alternatives

PATCH In review Ross Burton 2 participants 4 messages Nov 1, 2016 – Nov 2, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 util-linux: add su.1 to update-alternatives

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.

---
 meta/recipes-core/util-linux/util-linux.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +5 -3
index c635502..70cba6b 100644
@@ -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() {
Signature · 1 line
2.8.1
#1 lore raw

PATCH 2/2 shadow: add nologin.8 to alternatives

---
 meta/recipes-extended/shadow/shadow.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-extended/shadow/shadow.inc +2 -1
index 35a18f8..f79565b 100644
@@ -180,11 +180,12 @@ ALTERNATIVE_${PN}-base = "newgrp groups login su"
 ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
 ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
 
-ALTERNATIVE_${PN}-doc = "passwd.5 getspnam.3 groups.1 su.1"
+ALTERNATIVE_${PN}-doc = "passwd.5 getspnam.3 groups.1 su.1 nologin.8"
 ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
 ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
 ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
 ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1"
+ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8"
 
 pkg_postinst_${PN} () {
 	if [ "x$D" != "x" ]; then
Signature · 1 line
2.8.1
#2 lore raw

Re: [PATCH 2/2] shadow: add nologin.8 to alternatives

Hi Ross,

Quoted 1 line · On Tue, 01 Nov 2016 15:06:53 Ross Burton wrote:

Missing commit message. Probably the most important thing to include would be which other recipe packages the same named binary.

Thanks,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#3 lore raw

Re: [PATCH 2/2] shadow: add nologin.8 to alternatives

Quoted 4 lines · Paul Eggleton

Missing commit message. Probably the most important thing to include would be
which other recipe packages the same named binary.

Fixed in git, thanks. I meant to go back and fill this in...

Ross