Home » PEAR » PEAR_Command_Packaging » Bug #6377
"pear makerpm" post/postun improvements to cope with non-RPM installs
Details
| Submitted | 2005-12-31 12:03 UTC |
|---|---|
| From | bugs at timj dot co dot uk |
| Assigned | timj |
| Status | Closed |
| Package | PEAR_Command_Packaging |
| PHP Version | 5.1.1 |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-12-31 12:03 UTC] bugs at timj dot co dot uk
Description:
------------
As per https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=176658
the post/postun scriptlets in the RPMs generated by "pear makerpm" can be improved to be simpler and to play nicer with previous (non-RPM) installations of modules, and non-RPM removals of modules that are installed as RPMs.
Test script:
---------------
In the below, "v1" and "v2" refer to any version of the package being tested, where v1 < v2. All the following test cases should result in successful installations/uninstallations, AND the package list supplied by PEAR ("pear list") should be consistent with the RPM database at the end of each test case.
TEST CASE 1
no existing installation
install v1 RPM
remove RPM
TEST CASE 2
no existing installation
install v1 RPM
upgrade to v2 RPM
remove RPM
TEST CASE 3
no existing installation
install v1 RPM
pear uninstall [package]
remove RPM
TEST CASE 4
existing non RPM v1 installation
install RPM of v2
remove RPM
TEST CASE 5
existing non RPM v2 installation
install RPM of v2
remove RPM
TEST CASE 6
existing non RPM v2 installation
install RPM of v1
remove RPM
Patch:
--- template.spec.1.7 2005-12-30 12:29:18.000000000 +0000
+++ template.spec.newpost 2005-12-31 11:55:57.000000000 +0000
@@ -33,18 +33,12 @@
%postun
# if refcount = 0 then package has been removed (not upgraded)
if [ "$1" -eq "0" ]; then
- pear uninstall --nodeps -r @possible_channel@@package@
+ pear uninstall --nodeps --ignore-errors --register-only @possible_channel@@package@
rm @rpm_xml_dir@/@package@.xml
fi
-
%post
-# if refcount = 2 then package has been upgraded
-if [ "$1" -ge "2" ]; then
- pear upgrade --nodeps -r @rpm_xml_dir@/@package@.xml
-else
- pear install --nodeps -r @rpm_xml_dir@/@package@.xml
-fi
+pear install --nodeps --soft --force --register-only @rpm_xml_dir@/@package@.xml
%install
pear -c %{buildroot}/pearrc install --nodeps -R %{buildroot} \
[2006-02-10 12:03 UTC] timj at php dot net
This bug has been fixed in CVS.
If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.