librelist archives

« back to archive

How to automatically remove old version when upgrading?

How to automatically remove old version when upgrading?

From:
Riobard
Date:
2010-12-05 @ 22:07
Hi, 

After upgrading a formula, the older version still exists in /Cellar. I 
know I can manually remove it, but I'm wondering if there is any default 
command that can automatically remove older versions when upgrading is 
done successfully? Thanks! 


Rio

Re: [homebrew] How to automatically remove old version when upgrading?

From:
Mike McQuaid
Date:
2010-12-05 @ 22:08
On 5 December 2010 22:07, Riobard <me@riobard.com> wrote:
> After upgrading a formula, the older version still exists in /Cellar. I 
know I can manually remove it, but I'm wondering if there is any default 
command that can automatically remove older versions when upgrading is 
done successfully? Thanks!

Nope and you probably don't want to do this as lots of programs take
the full paths to executables/libraries rather than the symlinks.

-- 
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] How to automatically remove old version when upgrading?

From:
Riobard
Date:
2010-12-06 @ 00:37
On 2010-12-05, at 18:38, Mike McQuaid wrote:

> On 5 December 2010 22:07, Riobard <me@riobard.com> wrote:
>> After upgrading a formula, the older version still exists in /Cellar. I
know I can manually remove it, but I'm wondering if there is any default 
command that can automatically remove older versions when upgrading is 
done successfully? Thanks!
> 
> Nope and you probably don't want to do this as lots of programs take
> the full paths to executables/libraries rather than the symlinks.


So what's the usual way to remove installed formulas? 

Re: [homebrew] How to automatically remove old version when upgrading?

From:
Christer Solskogen
Date:
2010-12-06 @ 07:37
On Mon, Dec 6, 2010 at 1:37 AM, Riobard <me@riobard.com> wrote:
>
> On 2010-12-05, at 18:38, Mike McQuaid wrote:
>
>> On 5 December 2010 22:07, Riobard <me@riobard.com> wrote:
>>> After upgrading a formula, the older version still exists in /Cellar. 
I know I can manually remove it, but I'm wondering if there is any default
command that can automatically remove older versions when upgrading is 
done successfully? Thanks!
>>
>> Nope and you probably don't want to do this as lots of programs take
>> the full paths to executables/libraries rather than the symlinks.
>
>
> So what's the usual way to remove installed formulas?
>

I use "brew cleanup" - and there is no problem using that command if
you know what you are doing. For instance, if you upgrade python and
remove the old version you *have* to reinstall everything that depends
on python.


-- 
chs,

Re: How to automatically remove old version when upgrading?

From:
Max Howell
Date:
2010-12-06 @ 11:00
 Notably this can be mostly fixed. Mostly it's just a bunch of 
install_name_tooling.


Any stuff that depends on absolute paths for binaries should be fixed at 
the formula level.


This is also a good reason not to install things like Python with 
Homebrew. Virtualenv is the better solution.


At some point I will finish `brew upgrade`. Until then commands like 
cleanup may require to re install some formula.

> 
> > >> After upgrading a formula, the older version still exists in 
/Cellar. I know I can manually remove it, but I'm wondering if there is 
any default command that can automatically remove older versions when 
upgrading is done successfully? Thanks!
> > >
> > > Nope and you probably don't want to do this as lots of programs take
> > > the full paths to executables/libraries rather than the symlinks.
> > 
> >  So what's the usual way to remove installed formulas?
> > @riobard.com>
> > 
> I use "brew cleanup" - and there is no problem using that command if
> you know what you are doing. For instance, if you upgrade python and
> remove the old version you *have* to reinstall everything that depends
> on python.
> 
> 
> 

Re: [homebrew] Re: How to automatically remove old version when upgrading?

From:
Mike McQuaid
Date:
2010-12-06 @ 11:29
On 6 December 2010 11:00, Max Howell <max@methylblue.com> wrote:
> Notably this can be mostly fixed. Mostly it's just a bunch of
> install_name_tooling.
> Any stuff that depends on absolute paths for binaries should be fixed at the
> formula level.
> At some point I will finish `brew upgrade`. Until then commands like cleanup
> may require to re install some formula.

Sure, this stuff can be fixed, just that's why it hasn't been yet.
It'll need to be working for a while before we'd add any automatic
removal.

> This is also a good reason not to install things like Python with Homebrew.
> Virtualenv is the better solution.

Eventually, we should just stop supporting things like this, when
other tools are full-featured enough to mean that we can.

-- 
Mike McQuaid
http://mikemcquaid.com

Re: How to automatically remove old version when upgrading?

From:
Max Howell
Date:
2010-12-06 @ 11:32

> 
> > This is also a good reason not to install things like Python with Homebrew.
> >  Virtualenv is the better solution.
> > 
> Eventually, we should just stop supporting things like this, when
> other tools are full-featured enough to mean that we can.
> 
> 
> 
> 
I'd like to have `brew install rvm` and `brew install virtualenv`. Once we
have those, we can just remove the ruby and python formula IMO.





Ideally we'd make the rvm and virtualenv formula use Homebrew stuff.


And I reserve the right to be wrong and totally go back on what I just 
said as I am not a user of each tool (rvm or virtualenv).


Max

Re: [homebrew] Re: How to automatically remove old version when upgrading?

From:
Dreamcat4
Date:
2010-12-06 @ 18:37
On Mon, Dec 6, 2010 at 11:32 AM, Max Howell <max@methylblue.com> wrote:
> This is also a good reason not to install things like Python with Homebrew.
> Virtualenv is the better solution.
>
> Eventually, we should just stop supporting things like this, when
> other tools are full-featured enough to mean that we can.
>
> I'd like to have `brew install rvm` and `brew install virtualenv`. Once we

Max,
For rvm someone (me!) has already had a good crack at that.

In the end I took your homebrew system-side install script.
Then just modified it to install rvm instead of homebrew.

Its available here:

https://gist.github.com/542746

The script will install rvm allongside homebrew within the /usr/local
prefix. Sudo is executed during the install in order to create the
toplevel stub dirs. But after installing, sudo isnt required anymore.


The reasoning for a seperate install script:

I didnt make a homebrew recipe because what rvm does its own
in-place self updating. So that would invalidate the keg versions
of homebrew.

Also if you install rvm into a keg - then all the
rubies and gems that rvm installs will be (inside) that keg's
subtree. Which would be highly problematic.

Then if upgrading rvm to a newer point release (in the traditional
homebrew way) would potentially throw away all your rvm-installed
stuff.

Its much cleaner to put a *system-wide* rvm allongside homebrew
than to solve the above problems.

> have those, we can just remove the ruby and python formula IMO.
> Ideally we'd make the rvm and virtualenv formula use Homebrew stuff.
> And I reserve the right to be wrong and totally go back on what I just said
> as I am not a user of each tool (rvm or virtualenv).
> Max

Re: [homebrew] Re: How to automatically remove old version when upgrading?

From:
Mike McQuaid
Date:
2010-12-06 @ 11:34
On 6 December 2010 11:32, Max Howell <max@methylblue.com> wrote:
> This is also a good reason not to install things like Python with Homebrew.
> Virtualenv is the better solution.
>
> Eventually, we should just stop supporting things like this, when
> other tools are full-featured enough to mean that we can.
>
> I'd like to have `brew install rvm` and `brew install virtualenv`. Once we
> have those, we can just remove the ruby and python formula IMO.
> Ideally we'd make the rvm and virtualenv formula use Homebrew stuff.
> And I reserve the right to be wrong and totally go back on what I just said
> as I am not a user of each tool (rvm or virtualenv).

Sounds good. We could even make brew install python/ruby install the
latest version.

As you know, I'm an extreme systemduplicatist.


-- 
Mike McQuaid
http://mikemcquaid.com

Re: How to automatically remove old version when upgrading?

From:
Max Howell
Date:
2010-12-06 @ 11:36

> We could even make brew install python/ruby install the latest version.
> 
> 
> 
> 
We'll follow the protocol established with `brew install hg`. Homebrew 
doesn't hide anything from the user. Homebrew is transparent and flexible.



Re: [homebrew] How to automatically remove old version when upgrading?

From:
Matthieu Dubet
Date:
2010-12-05 @ 22:18
brew cleanup should do the trick

On Sun, Dec 5, 2010 at 11:08 PM, Mike McQuaid <mike@mikemcquaid.com> wrote:

> On 5 December 2010 22:07, Riobard <me@riobard.com> wrote:
> > After upgrading a formula, the older version still exists in /Cellar. I
> know I can manually remove it, but I'm wondering if there is any default
> command that can automatically remove older versions when upgrading is done
> successfully? Thanks!
>
> Nope and you probably don't want to do this as lots of programs take
> the full paths to executables/libraries rather than the symlinks.
>
> --
> Mike McQuaid
> http://mikemcquaid.com
>

Re: [homebrew] How to automatically remove old version when upgrading?

From:
Charlie Sharpsteen
Date:
2010-12-06 @ 00:14
On Sun, Dec 5, 2010 at 2:18 PM, Matthieu Dubet <maattdd@gmail.com> wrote:
>
> brew cleanup should do the trick

Still not advisable as Mike said.  I `brew cleanup`ed a keg-only
readline once and had to reinstall a significant amount of software.
For example, my entire Python stack had to be rebuilt.

-Charlie