Re: new pear revert command
| From: | Greg Beaver | Date: | Wed, 27 Aug 2003 19:08:13 +0000 |
| Subject: | Re: new pear revert command | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20673@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
[regarding pear revert]
I dont get it .. what can't you do with the existing commands? You can do anything with the existing commands, except automatically determine which dependencies might break if you use pear install --force (the only other way to revert).I did consider adding in the option of just saying "pear revert Packagename" which would find the last version that matches the preferred_state, but felt it was too risky to make this automatic. Let me say for the record that revert is totally unnecessary if you ignore the patches for --alldeps, and subpackages. Only when dependencies begin to be handled automatically will a revert command be important. If you have a bunch of subpackages installed, and you do: pear upgrade --alldeps Package and it breaks, you will want to be able to selectively downgrade the subpackages. This can be accomplished by a full uninstall as well, but if any other packages depend on Package, then --nodeps must be used, and each subpackage must be uninstalled manually. The possibility of user error escalates, and the time involved also does as the admin tries to figure out the mess. Forcing users to use --nodeps and --force is a dangerous thing - it contains the potential to completely screw up the dependencies, which is the strongest feature of PEAR (and honestly, the entire point of PEAR is to make it easy to have dependencies on other people's code in your own redistributable code without worrying about it breaking when other users install it, right?). So, what it offers is the possibility to handle a complex downgrade gracefully without requiring the user to be smart (which --nodeps/--force do require). After this explanation, it occurs to me that it could also just accept the option --alldeps and --onlyreqdeps so that it can be used right after pear upgrade --alldeps or pear upgrade --onlyreqdeps This functionality could be added to install --force only by a serious re-write of my re-write of the installation code :). As it stands, I add about 50 lines of code to PEAR/Command/Install.php Greg