Bug 45210
Summary: | uninstall scripts being run after upgrade | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Need Real Name <mike_harris> |
Component: | rpm | Assignee: | Jeff Johnson <jbj> |
Status: | CLOSED NOTABUG | QA Contact: | David Lawrence <dkl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.2 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2001-06-20 21:36:14 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: |
Description
Need Real Name
2001-06-20 21:36:09 UTC
In rpm, an upgrade is an install followed by an erase. To distinguish between %preun/%postun being called by either --update or --erase, you need to test the first argument passed to the script, which is always the number of instances of the package that will be present at the end of the execution of the script. That means your %preun/%postun scriptlets need to be written something like %preun if [ $1 == 0 ]; then echo "This is an rpm --erase command." else echo "This is an rpm --update command." fi |