Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #5959 patch: pear makerpm produces RPMs that do not uninstall/upgrade cleanly
Submitted: 2005-11-14 14:25 UTC
From: bugs at timj dot co dot uk Assigned: cellog
Status: Closed Package: PEAR
PHP Version: 5.0.4 OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 40 - 37 = ?

 
 [2005-11-14 14:25 UTC] bugs at timj dot co dot uk
Description: ------------ $ pear -V PEAR Version: 1.4.4 PHP Version: 5.0.4 Zend Engine Version: 2.0.4-dev After building packages made with "pear makerpm", the installed package can neither be upgraded nor erased cleanly. This is not the same as bug #4354. Test script: --------------- Examples done using HTTP 1.3.5/1.3.6 Example 1: Erasing # rpm -i PEAR\:\:HTTP-1.3.5-1.noarch.rpm # rpm -e PEAR::HTTP Example 2: Upgrading # rpm -i PEAR\:\:HTTP-1.3.5-1.noarch.rpm # rpm -U PEAR\:\:HTTP-1.3.6-1.noarch.rpm Patch: # diff -u template.spec.orig template.spec --- template.spec.orig +++ template.spec @@ -31,11 +31,18 @@ echo BuildRoot=%{buildroot} %postun -pear uninstall --nodeps -r @possible_channel@@package@ -rm @rpm_xml_dir@/@package@.xml +# if refcount = 0 then package has been removed (not upgraded) +if [ "$1" -eq "0" ]; then + pear uninstall --nodeps -r @possible_channel@@package@ +fi %post -pear install --nodeps -r @rpm_xml_dir@/@package@.xml +# 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 %install pear -c %{buildroot}/pearrc install --nodeps -R %{buildroot} \ Expected result: ---------------- (this is the result after applying above patch) Example 1 output: [install] install ok: channel://pear.php.net/HTTP-1.3.5 [uninstall] uninstall ok: channel://pear.php.net/HTTP-1.3.5 Example 2 output: [install] install ok: channel://pear.php.net/HTTP-1.3.5 [upgrade] upgrade ok: channel://pear.php.net/HTTP-1.3.6 Actual result: -------------- Example 1 output: [install] install ok: channel://pear.php.net/HTTP-1.3.5 [uninstall] pear/HTTP not installed rm: cannot remove `/var/lib/pear/HTTP.xml': No such file or directory error: %postun(PEAR::HTTP-1.3.5-1.noarch) scriptlet failed, exit status 1 Example 2 output: [install] install ok: channel://pear.php.net/HTTP-1.3.5 [upgrade] Skipping package "pear/HTTP", already installed as version 1.3.5 No valid packages found install failed error: %post(PEAR::HTTP-1.3.6-1.noarch) scriptlet failed, exit status 1

Comments

 [2005-11-16 03:30 UTC] cellog
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.