Re: pear revert command questions

From: Date: Sun, 21 Sep 2003 07:26:19 +0000
Subject: Re: pear revert command questions
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-21858@lists.php.net to get a copy of this message
On 20 Sep 2003 at 23:59, Greg Beaver wrote: > 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 my eyes this should be okay. Downgrading, by it's nature, is a quite difficult thing - but it seems that your revert proposal takes care of everything I can think of right now, by reverting only those packages which need to be reverted. Doing it manual is the standard-way but having a --all-deps would be a nice feature if you have, at some point, maybe 10 updated interdependency-packages because you updated one of those :-) Hypothetical, okay, but ... Another thing: In your example Net_Socket 1.0 was installed before, Net_Socket 1.2 has the problems. So would there be a way to downgrade to Net_Socket 1.1 without downloading it as a tgz and installating it "manually"? This way, in your first example, Net_SMTP would still work because it depends on 1.1. And having the assumtion that most times only the last version should fail (normally it wouldn't fail because of all the unit-tests we provide :-)) maybe downgrading to Net_Socket 1.1 is sufficient. Stefan

« previous php.pear.dev (#21858) next »