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

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 : 15 - 10 = ?

 
 [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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!