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

Bug #13315 Upgrading of package fails if more than one file of role=cfg has changed
Submitted: 2008-03-05 13:10 UTC
From: timj Assigned: timj
Status: Closed Package: PEAR (version 1.7.1)
PHP Version: Irrelevant OS:
Roadmaps: 1.7.2    
Subscription  


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 : 7 + 3 = ?

 
 [2008-03-05 13:10 UTC] timj (Tim Jackson)
Description: ------------ If a package contains two or more files with role set to "cfg", and upon upgrading, the "new" contents of more than one of those files differs from the "old" contents, the upgrade fails. Test script: --------------- 1. Create a package called "test", version 1.0.0 with just two files in it: test1.ini and test2.ini (both with role=cfg) 2. Install that package 3. Edit test1.ini and test2.ini in the package such that the content of both files changes. 4. Bump the package version to 1.0.1 5. Do a "pear upgrade" on the package Expected result: ---------------- The upgrade runs as normal, and in the installed cfg dir we have: test1.ini test1.ini.new-1.0.1 test2.ini test2.ini.new-1.0.1 Actual result: -------------- Could not rename /temp/savefile to /pear/cfg/test/test2.ini copy(/temp/savefile): failed to open stream: No such file or directory ERROR: commit failed where: "/temp" is the directory defined by temp_dir "/pear/cfg" is the directory defined by cfg_dir The output cfg directory looks like this: test1.ini test1.ini.new-1.0.1 test2.ini

Comments

 [2008-03-05 13:15 UTC] timj (Tim Jackson)
This is due to Role/Cfg.php using a temp file called "savefile" which doesn't take into account the possibility of multiple files needed to be dealt with. The attached patch (pear-bug-13315.patch) fixes the problem completely.
 [2008-03-13 14:45 UTC] timj (Tim Jackson)
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.