[OE-core] [PATCH 1/3] man-pages/shadow: resolve man pages confliction

Hongxu Jia hongxu.jia at windriver.com
Wed Oct 29 05:54:49 UTC 2014


Invoke smart/rpm to install man-pages and shadow-doc, there
is a build failure:
...
|error: file /usr/share/man/man5/passwd.5 from install of
shadow-doc-4.2.1-r0.0.core2_64 conflicts with file from
package man-pages-3.70-r0.0.core2_64
|error: file /usr/share/man/man3/getspnam.3 from install of
shadow-doc-4.2.1-r0.0.core2_64 conflicts with file from
package man-pages-3.70-r0.0.core2_64
...
Use alternatives mechanism to fix it.

As README in man-pages said: "Note that sometimes these
pages are duplicates of pages also distributed in other
packages. Be careful not to overwrite more up-to-date
versions. So we set man-pages with lower priority.

[YOCTO #6769]

Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
---
 meta/recipes-extended/man-pages/man-pages_3.71.bb | 7 +++++++
 meta/recipes-extended/shadow/shadow.inc           | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/meta/recipes-extended/man-pages/man-pages_3.71.bb b/meta/recipes-extended/man-pages/man-pages_3.71.bb
index 759bad5..225b256 100644
--- a/meta/recipes-extended/man-pages/man-pages_3.71.bb
+++ b/meta/recipes-extended/man-pages/man-pages_3.71.bb
@@ -27,3 +27,10 @@ do_install() {
 # Only deliveres man-pages so FILES_${PN} gets everything
 FILES_${PN}-doc = ""
 FILES_${PN} = "${mandir}/*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "passwd.5 getspnam.3"
+ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
+ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index 6a769df..20773e7 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -158,6 +158,10 @@ ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
 ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
 ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
 
+ALTERNATIVE_${PN}-doc = "passwd.5 getspnam.3"
+ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
+ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
+
 pkg_postinst_${PN} () {
 	if [ "x$D" != "x" ]; then
 	  rootarg="--root $D"
-- 
1.9.1




More information about the Openembedded-core mailing list