Bug 175727
Summary: | RPM %pre failure causes installaed package to uninstall | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Ritesh Raj Sarraf <ritesh_sarraf> | ||||||||||
Component: | rpm | Assignee: | Paul Nasrat <nobody+pnasrat> | ||||||||||
Status: | CLOSED WONTFIX | QA Contact: | Mike McLean <mikem> | ||||||||||
Severity: | high | Docs Contact: | |||||||||||
Priority: | medium | ||||||||||||
Version: | 4.0 | CC: | ritesh_sarraf, tao, wwlinuxengineering | ||||||||||
Target Milestone: | --- | ||||||||||||
Target Release: | --- | ||||||||||||
Hardware: | All | ||||||||||||
OS: | Linux | ||||||||||||
Whiteboard: | |||||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | 2005-12-15 19:18:36 UTC | Type: | --- | ||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||
Documentation: | --- | CRM: | |||||||||||
Verified Versions: | Category: | --- | |||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||||
Embargoed: | |||||||||||||
Attachments: |
|
Description
Ritesh Raj Sarraf
2005-12-14 11:50:11 UTC
rpm is behaving as intended - rpm has performed a best effort install. To satisfy the requirements the packages need to be installed first, and thus are. There is no use for package "a" if the package on which it is dependent fails to get installed i.e. package "b". For example: bash depends on package glibc. glibc is a meta-package which further depends on glibc-i386. Now in a directory where only packages bash and glibc are present, the command `rpm -Uvh *.rpm` should abort because the dependency isn't resolved. To comment your last line, the dependency needs to be installed first which as per my example is glibc-i386 and _not_ package bash. I'm sure this dependency handling mechanism should be well implemented in "yum" but rpm, unless given with the force option, should simply abort such installations. This is well implemented in dpkg and apt. The package set is done as an entire transaction; they are not independent events that can be cancelled based on the failure of earlier packages. Created attachment 122270 [details]
Dummy Package a.rpm
This is a Dummy Package a.rpm.
This will try to clarify the bug
Created attachment 122271 [details]
Dummy Package b.rpm
Dummy Package b.rpm
Created attachment 122272 [details]
Package a's spec file
spec file
Created attachment 122273 [details]
spec file
Package b's spec file
Sorry for the confusing explanation in Comment #2. Here's the real problem. Package a depends on Package b. Package b fails to install because its %pre is not successful, hence Package b isn't installed and exits with a bad status. But still Package a gets installed. Now shouldn't the whole installation get aborted because hitting `rpm -Uvh *.rpm` would include both Packages' successes and failures into "one single transaction" ? I've attached two dummy rpm's (a and b) and the spec files for explanation. Try the steps mentioned in the Bug Comment to reproduce it. Dependency checking and %pre running are different. The running of %pre is way too late to prevent installation of an entire set of packages chained through dependencies. Simply doesn't "work", and the change to rpm is highly unlikely. Either add dependencies that achieve the same goal as whatever you are doing in %pre (that's probably the best solution), or run your %pre script before executing rpm. Alternatively, it's now possible in rpm-4.4.3 and later to run a script during dependency checking. |