pear revert command questions
| From: | Greg Beaver | Date: | Sun, 21 Sep 2003 03:59:19 +0000 |
| Subject: | pear revert command questions | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-21855@lists.php.net to get a copy of this message | ||
Hi,
I'm writing code for the new pear revert command, and have some questions that I'm not comfortable answering on my own :)
Let's say, for example, that Net_SMTP version 1.5 requires Net_Socket >= 1.1, and is installed using this command-line switch sequence:
$ pear list
[cut]
Net_Socket 1.0
Net_SMTP 1.4
[cut]
$ pear upgrade --alldeps Net_SMTP
Net_SMTP 1.5 installed successfully
Net_Socket 1.2 installed successfully.
It turns out there is a bug in Net_Socket 1.2 that breaks Net_SMTP (this is unlikely to actually happen, but pretend it does). Now
$ pear revert Net_Socket
Net_SMTP depends on Net_Socket version 1.1, cannot revert
$ pear revert Net_SMTP Net_Socket
Net_SMTP reverted to version 1.4 successfully
Net_Socket reverted to version 1.0 successfully
Now, this is fine, but what about cases like nested dependencies of SOAP. Pretend HTTP_Request 1.2 depends on Net_Socket >= 1.1 as well. Also pretend SOAP 1.0 depends on HTTP_Request >= 1.2
$ pear upgrade --alldeps SOAP
SOAP 1.0 installed
Net_Socket 1.2 installed
HTTP_Request 1.2 installed
$ pear upgrade Net_SMTP
Net_SMTP 1.5 installed successfully
Now, we have the same hypothetical situation - Net_Socket 1.2 breaks Net_SMTP, so we need to revert
$ pear revert Net_Socket
HTTP_Request depends on Net_Socket version 1.1, cannot revert
Net_SMTP depends on Net_Socket version 1.1, cannot revert
$ pear revert HTTP_Request Net_SMTP Net_Socket
SOAP depends on HTTP_Request version 1.2, cannot revert
$ pear revert HTTP_Request Net_SMTP Net_Socket SOAP
Net_SMTP reverted to version 1.4 successfully
Net_Socket reverted to version 1.0 successfully
HTTP_Request reverted to version 1.1.1 successfully
SOAP reverted to version 0.8RC2 successfully
My question is do you think it is safe to add an --alldeps option to revert?
My thinking is that revert would simply check dependencies, and only attempt to revert packages that have
1) been upgraded before
2) a greater version number than the one allowed by a dependent package
In other words, it won't attempt to revert all dependencies, just those that fail a >= version test for the older package.
Or is it something that should always be manual as demonstrated above?
Greg