Bug 1760

Summary: rpm upgrades fail for recipes using update-alternatives
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Paul Eggleton <bluelightning>
Component: meta-yoctoAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Undecided CC: poky.bs.watcher, poky.watcher
Version: unspecified   
Target Milestone: 1.2   
Hardware: All   
OS: Multiple   
Whiteboard: Fix merged (10 Nov)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Paul Eggleton 2011-11-08 08:20:48 UTC
If a recipe uses update-alternatives in postinst/prerm, this will cause failures with rpm packaging during upgrade as we expect (based on assumptions from opkg) that prerm/postrm occur after postinst. For an example see the original report on the mailing list:

https://lists.yoctoproject.org/pipermail/yocto/2011-November/005559.html

Mark Hatle has suggested using guard wrappers for the prerm/postrm scripts within package_rpm.bbclass that check the calling argument - rpm specifies how many versions of the package are still installed; if the answer is not 0 then according to the behaviour of opkg in this situation we should be able to skip all prerm/postrm scripts, although careful examination of all of these scripts as well as ones in meta-oe should be done to ensure this won't cause any issues.
Comment 1 Paul Eggleton 2011-11-10 07:22:53 UTC
Fixed merged in revision 7b645cac3f7e89c20918e83d61352ccc5f8b63be.