fix man-pages confliction and smart install with --attempt failed
cover fix man-pages confliction and smart install with --attempt failed
1. vim local.conf
...IMAGE_INSTALL_append = "shadow man-pages hdparm"EXTRA_IMAGE_FEATURES += "doc-pkgs"
...
2. bitbake core-image-minimal
//Hongxu
The following changes since commit dacc4ce59e48129a1a1e5316e10780f7358e29ef:
nativesdk-cmake: Adjust toolchain paths dynamically (2014-10-24 21:59:46 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib hongxu/fix-man-pages
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-man-pages
Hongxu Jia (3):
man-pages/shadow: resolve man pages confliction
python-smartpm: report warn rather than error during install with
--attempt
rootfs.py: tweak inner warn message catching
meta/lib/oe/rootfs.py | 2 +- .../python/python-smartpm/smart-attempt.patch | 27 +++++++++++++++++++--- meta/recipes-extended/man-pages/man-pages_3.71.bb | 7 ++++++ meta/recipes-extended/shadow/shadow.inc | 4 ++++ 4 files changed, 36 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/3 man-pages/shadow: resolve man pages confliction
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]
--- meta/recipes-extended/man-pages/man-pages_3.71.bb | 7 +++++++ meta/recipes-extended/shadow/shadow.inc | 4 ++++ 2 files changed, 11 insertions(+)
meta/recipes-extended/man-pages/man-pages_3.71.bb +7 -0
@@ -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"
meta/recipes-extended/shadow/shadow.inc +4 -0
@@ -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"
Signature · 1 line
1.9.1
PATCH 2/3 python-smartpm: report warn rather than error during install with --attempt
In reply to Hongxu JiaWith the following config and build image:
...IMAGE_INSTALL_append = "shadow man-pages"EXTRA_IMAGE_FEATURES += "doc-pkgs"
...
There is an error during install with --attempt, and it breaks the build.
...
|error: file /usr/share/man/man5/passwd.5 from install of shadow-doc-4.2.1-r0.i586 conflicts with file from package man-pages-3.71-r0.i586
...
For complementary and 'attemptonly' package processing, we should make sure the warn rather than error messages reported.
[YOCTO #6769]
--- .../python/python-smartpm/smart-attempt.patch | 27 +++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-)
meta/recipes-devtools/python/python-smartpm/smart-attempt.patch +24 -3
@@ -1,4 +1,4 @@ -From 7ee23804a06f81476cc2b31a6db11b52d7af764e Mon Sep 17 00:00:00 2001 +From b105e7fe812da3ccaf7155c0fe14c8728b0d39a5 Mon Sep 17 00:00:00 2001 From: Mark Hatle <[email protected]> Date: Mon, 20 Jan 2014 14:30:52 +0000 Subject: [PATCH] Add mechanism to attempt install without failing
@@ -13,11 +13,32 @@ Upstream-Status: Pending Signed-off-by: Mark Hatle <[email protected]> Signed-off-by: Paul Eggleton <[email protected]> + +For complementary and 'attemptonly' package processing, we should +make sure the warn rather than error reported. +Signed-off-by: Hongxu Jia <[email protected]> --- + smart.py | 5 +++- smart/commands/install.py | 5 ++++ smart/transaction.py | 65 +++++++++++++++++++++++++++++++++++------------ - 2 files changed, 54 insertions(+), 16 deletions(-) + 3 files changed, 58 insertions(+), 17 deletions(-) +diff --git a/smart.py b/smart.py +index c5c7a02..7e7fd34 100755 +--- a/smart.py ++++ b/smart.py +@@ -179,7 +179,10 @@ def main(argv): + if opts and opts.log_level == "debug": + import traceback + traceback.print_exc() +- if iface.object: ++ if iface.object and sysconf.has("attempt-install", soft=True): ++ iface.warning(unicode(e)) ++ exitcode = 0 ++ elif iface.object: + iface.error(unicode(e)) + else: + sys.stderr.write(_("error: %s\n") % e) diff --git a/smart/commands/install.py b/smart/commands/install.py index 590222c..6ef9682 100644 --- a/smart/commands/install.py
@@ -163,5 +184,5 @@ index 5730a42..e3e61c6 100644 self._remove(pkg, changeset, locked, pending) elif op is UPGRADE: -- -1.8.4.2 +1.9.1
Signature · 1 line
1.9.1
PATCH 3/3 rootfs.py: tweak inner warn message catching
In reply to Hongxu JiaThe fix filters out irrelevant messages, and makes the catching more accurate, the inner warn message in do_rootfs usually comes from the output of complementary install, and pattern the format to catch it.
Here is the example of irrelevant messages:
...
|WARNING: log_check: There is a warn message in the logfile |WARNING: log_check: Matched keyword: [warn] |WARNING: log_check: `tmp/deploy/rpm/core2_64/pam-plugin-warn
-1.1.6-r5.0.core2_64.rpm' -> `tmp/work/intel_x86_64-wrs-linux/ wrlinux-image-installer/1.0-r0/rootfs/Packages.intel/./core2_64/ pam-plugin-warn-1.1.6-r5.0.core2_64.rpm'
...
--- meta/lib/oe/rootfs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oe/rootfs.py +1 -1
@@ -348,7 +348,7 @@ class RpmRootfs(Rootfs): pass def _log_check_warn(self): - r = re.compile('(warn|Warn)') + r = re.compile('^(warn|Warn|NOTE: warn|NOTE: Warn)') log_path = self.d.expand("${T}/log.do_rootfs") with open(log_path, 'r') as log: for line in log.read().split('\n'):
Signature · 1 line
1.9.1