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

Bug #10661 Failure to install local package
Submitted: 2007-04-09 06:47 UTC
From: techtonik Assigned: cellog
Status: Closed Package: PEAR (version 1.5.2)
PHP Version: 4.4.4 OS: Linux
Roadmaps: 1.5.3    
Subscription  


 [2007-04-09 06:47 UTC] techtonik (anatoly techtonik)
Description: ------------ See test script for confusing command behaviour. Shoudn't PEAR look for local package file first? I find all the messages about channels rather confusing for non-PEAR developers. Test script: --------------- $ ../bin/pear install File_SearchReplace-1.1.2.tgz Failed to download pear/File_SearchReplace, version "1.1.2", latest release is version 1.1.1, stability "stable", use "channel://pear.php.net/File_SearchReplace-1.1.1" to install Cannot initialize 'channel://pear.php.net/File_SearchReplace-1.1.2.tgz', invalid or missing package file Package "channel://pear.php.net/File_SearchReplace-1.1.2.tgz" is not valid install failed $ ../bin/pear install -O File_SearchReplace-1.1.2.tgz Cannot download non-local package "channel://pear.php.net/File_SearchReplace-1.1.2.tgz" Package "channel://pear.php.net/File_SearchReplace-1.1.2.tgz" is not valid install failed $ ../bin/pear install ./File_SearchReplace-1.1.2.tgz install ok: channel://pear.php.net/File_SearchReplace-1.1.2 $

Comments

 [2007-04-09 13:35 UTC] cellog (Greg Beaver)
Tias: this is due to your patch for improving upgrade.
 [2007-04-09 17:12 UTC] tias (Tias Guns)
Hello Techtonik, Thank you for you bugreport, pear indeed did not suppose the file was local. The attached patch solves this, and always gives the output: install ok: channel://pear.php.net/File_SearchReplace-1.1.2 To PEAR developers: When trying to install a more-up-to-date local package, while another one is already installed, it gives following output: Skipping package "pear/PEAR_Frontend_Web", already installed as version 0.5.2 No valid packages found install failed A clean solution is to automatically set the option 'force' when a local or a URL package is given, as this is what the user thinks he wants. The attached patch does this too. g,T
 [2007-04-10 02:07 UTC] cellog (Greg Beaver)
using --force implicitly is *very* dangerous as this ignores dependency failures. A better solution is needed.
 [2007-04-10 04:02 UTC] cellog (Greg Beaver)
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.
 [2007-04-10 04:02 UTC] cellog (Greg Beaver)
this needs to be merged from PEAR_5_1 to HEAD
 [2007-04-10 10:17 UTC] tias (Tias Guns)
Hey Greg, There is some confusion, there are 2 similar problems, the first one is reported in this original bugreport: 1) No package is installed, trying to install a local package: This is fixed in my original patch (remote the $options['force'] = true lines) [I don't understand the clue of your patch, so don't know which one is cleanest] 2) Package is installed, trying to install a local package (of a higher version): [tias@tiasus]test sh bin/pear -c pear.conf list | grep _Web PEAR_Frontend_Web 0.5.2 alpha [tias@tiasus]test sh bin/pear -c pear.conf install ../PEAR_Frontend_Web-0.5.3.tgz Skipping package "pear/PEAR_Frontend_Web", already installed as version 0.5.2 No valid packages found install failed Note that this behaviour is not reported by a user ! I stumbled upon it myself and found it a bit confusing too. The 'Skipping package...' thing is from somewhere in $downloaded = &$this->downloader->download($packages); more exactly in PEAR/Downloader/Package.php::removeInstalled() So that one is rooted deeper, I proposed to ignore that problem by just setting the 'force' option ; ) In fact, the problem is that the user would say 'install' and not 'upgrade'. So, there are 3 options: 1) ignore this behaviour, user has to run 'upgrade' 2) automatically set 'upgrade' for local packages 3) make 'removeduplicate' only be a crybaby when the already installed package is effectively a >= version package, and not just when it is already installed (gives more sane error: ERROR: pear.php.net/PEAR_Frontend_Web is already installed) Greg, don't yet change stuff, I have to think some more about this, what do you think ?
 [2007-04-10 14:42 UTC] cellog (Greg Beaver)
if you wish to upgrade a package, i.e. from PEAR_Frontend_Web 0.5.2 to 0.5.3, use the upgrade command pear upgrade PEAR_Frontend_Web-0.5.3.tgz install is reserved for new installations. upgrade, however, will install a package that is not yet installed.
 [2007-04-19 16:58 UTC] tias (Tias Guns)
That's interesting: You think that 'pear upgrade <not_installed>' should _install_ te package. (#10768) But you think that 'pear install <./local_package-higher_version>' should not _upgrade_ the given package! I'd say we have to be consistent; either we allow the user to be a bit more sloppy and more humanlike with the commands, or either we don't implement this behaviour, for either one of them ! (of course, I'm in favor of implenting both; current behaviour: $ pear install ./pkg-1.1 Skipping package "chnl/pkg", already installed as version 0.2 Looks really silly)
 [2007-04-19 18:04 UTC] cellog (Greg Beaver)
please - this is how it has worked forever. there is no reason to change this