librelist archives

« back to archive

How do you 'hold' a package

How do you 'hold' a package

From:
David Reynolds
Date:
2011-02-10 @ 22:37
I don't really want my postgresql to upgrade beyond 8.4 - is there any way
to 'hold' the install so that 'brew outdated' won't bug me about it?
-- 
David Reynolds
david@reynoldsfamily.org.uk

Re: [homebrew] How do you 'hold' a package

From:
Adam Vandenberg
Date:
2011-02-10 @ 22:39
There's no current support for this, sorry.

It could be added as an "external command", though, which kept its own
list of "held packages" and then did the "brew outdated" logic but
grepped out the held packages...

On Thu, Feb 10, 2011 at 2:37 PM, David Reynolds
<david@reynoldsfamily.org.uk> wrote:
> I don't really want my postgresql to upgrade beyond 8.4 - is there any 
way to 'hold' the install so that 'brew outdated' won't bug me about it?
> --
> David Reynolds
> david@reynoldsfamily.org.uk
>
>

Re: [homebrew] How do you 'hold' a package

From:
Christer Solskogen
Date:
2011-02-11 @ 07:31
On Thu, Feb 10, 2011 at 11:39 PM, Adam Vandenberg <flangy@gmail.com> wrote:
> There's no current support for this, sorry.
>

Are you sure?
One way of dealing with it is to have a separate formula for each
major version of postgresql.

-- 
chs,

Re: [homebrew] How do you 'hold' a package

From:
Mike McQuaid
Date:
2011-02-11 @ 08:11
On 11 February 2011 07:31, Christer Solskogen
<christer.solskogen@gmail.com> wrote:
> On Thu, Feb 10, 2011 at 11:39 PM, Adam Vandenberg <flangy@gmail.com> wrote:
>> There's no current support for this, sorry.
> Are you sure?

Yes.

> One way of dealing with it is to have a separate formula for each
> major version of postgresql.

This breaks when anything depends against postgresql. We know this is
a problem for some people, we will fix it at some stage. If there was
an easy and good fix we'd have made it.

-- 
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] How do you 'hold' a package

From:
Christer Solskogen
Date:
2011-02-11 @ 08:29
On Fri, Feb 11, 2011 at 9:11 AM, Mike McQuaid <mike@mikemcquaid.com> wrote:

> This breaks when anything depends against postgresql. We know this is
> a problem for some people, we will fix it at some stage. If there was
> an easy and good fix we'd have made it.
>

When I get to know ruby I think I have something to contribute.
Archlinux have a cool way of dealing with that, and that is with a
keyword called "provides".
That means that packages that depend postgresql really depends on what
that package provides. It does not care if the user have installed
postgres84 or postgres90. (Its up to the maintainer to ensure that the
package that depends on postgres works with both 8.4.x and 9.0.x)


-- 
chs,

Re: [homebrew] How do you 'hold' a package

From:
Mike McQuaid
Date:
2011-02-11 @ 08:32
On 11 February 2011 08:29, Christer Solskogen
<christer.solskogen@gmail.com> wrote:
> When I get to know ruby I think I have something to contribute.
> Archlinux have a cool way of dealing with that, and that is with a
> keyword called "provides".

I'm aware of this. This is what most package management systems do.
Your contributions would be valuable but at the moment they rely on
other problems being fixed first.

> That means that packages that depend postgresql really depends on what
> that package provides. It does not care if the user have installed
> postgres84 or postgres90. (Its up to the maintainer to ensure that the
> package that depends on postgres works with both 8.4.x and 9.0.x)

Which doubles the maintenance overhead. It's worth remember we only
have four core contributors to Homebrew (and lots of lovely
volunteers) who try and look at every bug and fix problems. I'm
hesistant to add to our workload unless there is a really strong
reason with no workaround (which currently there isn't).

-- 
Mike McQuaid
http://mikemcquaid.com

Re: [homebrew] How do you 'hold' a package

From:
Lee Packham
Date:
2011-02-11 @ 08:41
We're starting to have this with node now - some people will want to stay 
on 0.2.x when 0.4.x is the current stable. However, nothing stops you 
having a fork which holds back that version. Yes that pushes the 
maintenance back to you but it lets Homebrew continue properly.

We could have a .homebrew file somewhere which lists packages to never 
list as outdated or upgrade *shrug*. Just a thought - that way you'll 
never notice you're behind on it.

Later 8.4.x releases of Postgres, for example, are only minor bugfixes 
anyway - so on a dev. box it is unlikely that you'll need them.

Just a thought.

Lee.
On Friday, 11 February 2011 at 08:32, Mike McQuaid wrote: 
> On 11 February 2011 08:29, Christer Solskogen
> <christer.solskogen@gmail.com> wrote:
> > When I get to know ruby I think I have something to contribute.
> > Archlinux have a cool way of dealing with that, and that is with a
> > keyword called "provides".
> 
> I'm aware of this. This is what most package management systems do.
> Your contributions would be valuable but at the moment they rely on
> other problems being fixed first.
> 
> > That means that packages that depend postgresql really depends on what
> > that package provides. It does not care if the user have installed
> > postgres84 or postgres90. (Its up to the maintainer to ensure that the
> > package that depends on postgres works with both 8.4.x and 9.0.x)
> 
> Which doubles the maintenance overhead. It's worth remember we only
> have four core contributors to Homebrew (and lots of lovely
> volunteers) who try and look at every bug and fix problems. I'm
> hesistant to add to our workload unless there is a really strong
> reason with no workaround (which currently there isn't).
> 
> -- 
> Mike McQuaid
> http://mikemcquaid.com
> 

Re: [homebrew] How do you 'hold' a package

From:
Max Howell
Date:
2011-02-11 @ 09:27
Hey Christer, could you provide an example of `provides'? In the context 
of a Homebrew formula?

I loved Archlinux incidentally. Pacman's format inspired the brew command 
somewhat. 
On Friday, 11 February 2011 at 08:29, Christer Solskogen wrote:
On Fri, Feb 11, 2011 at 9:11 AM, Mike McQuaid <mike@mikemcquaid.com> wrote:
> 
> > This breaks when anything depends against postgresql. We know this is
> > a problem for some people, we will fix it at some stage. If there was
> > an easy and good fix we'd have made it.
> 
> When I get to know ruby I think I have something to contribute.
> Archlinux have a cool way of dealing with that, and that is with a
> keyword called "provides".
> That means that packages that depend postgresql really depends on what
> that package provides. It does not care if the user have installed
> postgres84 or postgres90. (Its up to the maintainer to ensure that the
> package that depends on postgres works with both 8.4.x and 9.0.x)
> 
> 
> -- 
> chs,
> 

Re: [homebrew] How do you 'hold' a package

From:
Christer Solskogen
Date:
2011-02-11 @ 10:58
On Fri, Feb 11, 2011 at 10:27 AM, Max Howell <max@methylblue.com> wrote:
> Hey Christer, could you provide an example of `provides'? In the context of
> a Homebrew formula?
> I loved Archlinux incidentally. Pacman's format inspired the brew command
> somewhat.

It does not exist for Homebrew, yet. But I would love to implement it
when I learn some more ruby.
You can take a look at https://wiki.archlinux.org/index.php/PKGBUILD -
which describes how it works for Archlinux.

-- 
chs,

Re: [homebrew] How do you 'hold' a package

From:
Max Howell
Date:
2011-02-11 @ 09:29
Here's the quick solution for anyone that wants to make it:

/usr/local/Library/Hold/postgres 

Which is a symlink to /usr/local/Library/postgres/0.8

The symlink is just user-informative since Homebrew only needs the name.

`brew hold postgres' creates this. brew outdated and upgrade then ignore postgres.

Please ensure that upgrade and outdated warn about the hold or we'll get 
bug reports.

Max 
On Thursday, 10 February 2011 at 22:37, David Reynolds wrote:
I don't really want my postgresql to upgrade beyond 8.4 - is there any way
to 'hold' the install so that 'brew outdated' won't bug me about it?
> -- 
> David Reynolds
> david@reynoldsfamily.org.uk
> 

Re: [homebrew] How do you 'hold' a package

From:
David Reynolds
Date:
2011-02-11 @ 09:38
On 11 Feb 2011, at 09:29, Max Howell wrote:
> 
> Here's the quick solution for anyone that wants to make it:
> 
> /usr/local/Library/Hold/postgres 
> 
> Which is a symlink to /usr/local/Library/postgres/0.8
> 
> The symlink is just user-informative since Homebrew only needs the name.
> 
> `brew hold postgres' creates this. brew outdated and upgrade then ignore
postgres.
> 
> Please ensure that upgrade and outdated warn about the hold or we'll get
bug reports.

How would that cope with the dependancies of the recipe?

-- 
David Reynolds
david@reynoldsfamily.org.uk

Re: [homebrew] How do you 'hold' a package

From:
Max Howell
Date:
2011-02-11 @ 09:45
Upgrading deps doesn't effect anything that depends on them unless you 
rebuild the new one.

Cleanup should not cleanup deps that packages are built on. Which is a 
feature I have in the refactor branch. 
On Friday, 11 February 2011 at 09:38, David Reynolds wrote:
On 11 Feb 2011, at 09:29, Max Howell wrote:
> > 
> > Here's the quick solution for anyone that wants to make it:
> > 
> > /usr/local/Library/Hold/postgres 
> > 
> > Which is a symlink to /usr/local/Library/postgres/0.8
> > 
> > The symlink is just user-informative since Homebrew only needs the name.
> > 
> > `brew hold postgres' creates this. brew outdated and upgrade then 
ignore postgres.
> > 
> > Please ensure that upgrade and outdated warn about the hold or we'll 
get bug reports.
> 
> How would that cope with the dependancies of the recipe?
> 
> -- 
> David Reynolds
> david@reynoldsfamily.org.uk
> 

Re: [homebrew] How do you 'hold' a package

From:
Charlie Sharpsteen
Date:
2011-02-11 @ 09:31
On Thu, Feb 10, 2011 at 2:37 PM, David Reynolds <david@reynoldsfamily.org.uk
> wrote:

> I don't really want my postgresql to upgrade beyond 8.4 - is there any way
> to 'hold' the install so that 'brew outdated' won't bug me about it?
> --
> David Reynolds
> david@reynoldsfamily.org.uk
>
>
A possible solution is to use git-tag to "bookmark" certain versions of
formula.

Using Postgres as an example, examine the commit log for the formula in
question:

    git log /usr/local/Library/Formula/postgresql.rb

Page down until you find the commit that bumped PostgreSQL past 8.4.  In
this case, commit 7dc7cc reads:

Update PostgreSQL to 9.0.0.

So I know that the commit just before it, c32bea, probably contains a
version of PostgreSQL that is 8.4.

Next, create a tag pointing to that commit:

    git tag postgres-8.4 c32bea

Now, when you want to re-wind to that version run a checkout on that tag
that is restricted to a single file:

    git checkout postgres-8.4 -- /usr/local/Library/Formula/postgresql.rb

You could stash those checkout commands in a shell script and run it after
you run brew update to reset certain files to given states.  You could even
set an alias in `~/.profile` to make things easier:

    alias brewup='brew update &&
some-shell-script-with-lots-of-git-checkout-commands'


Of course you will still run into trouble with other formulae depending on
the latest version of the ones that you are forcing back to previous
versions.  The extra complexity added to dependency resolution and quality
control when not only the software, but the version is thrown into the
dependency mix is the reason this is not an easy problem to solve.


-Charlie

Re: [homebrew] How do you 'hold' a package

From:
Max Howell
Date:
2011-02-11 @ 09:51
This is a great tip and should be on the wiki. 
> A possible solution is to use git-tag to "bookmark" certain versions of formula.
> 
> Using Postgres as an example, examine the commit log for the formula in 
question: 
> 
> git log /usr/local/Library/Formula/postgresql.rb
> 
> Page down until you find the commit that bumped PostgreSQL past 8.4. In 
this case, commit 7dc7cc reads:
> 
> Update PostgreSQL to 9.0.0.
> 
> So I know that the commit just before it, c32bea, probably contains a 
version of PostgreSQL that is 8.4.
> 
> Next, create a tag pointing to that commit: 
> 
> git tag postgres-8.4 c32bea
> 
> Now, when you want to re-wind to that version run a checkout on that tag
that is restricted to a single file:
> 
> git checkout postgres-8.4 -- /usr/local/Library/Formula/postgresql.rb 
> 
> You could stash those checkout commands in a shell script and run it 
after you run brew update to reset certain files to given states. You 
could even set an alias in `~/.profile` to make things easier: 
> 
> alias brewup='brew update && 
some-shell-script-with-lots-of-git-checkout-commands'
> 
> 
> Of course you will still run into trouble with other formulae depending 
on the latest version of the ones that you are forcing back to previous 
versions. The extra complexity added to dependency resolution and quality 
control when not only the software, but the version is thrown into the 
dependency mix is the reason this is not an easy problem to solve.