librelist archives

« back to archive

Formulae quashing symlinks

Formulae quashing symlinks

From:
Julian Berman
Date:
2011-08-25 @ 15:09
Hi there.

Is there a way currently to efficiently manage formulae quashing other 
formulae's symlinks?

Specifically, I installed exuberant ctags and then a few months later 
installed emacs, only to discover that emacs had unexpectedly quashed the 
symlink for ctags with its own (GNU) ctags.

If there isn't, perhaps something like a `brew bins` command to list the 
binaries a formula will symlink (if there isn't something like this 
already), as well as a `brew link <formula> <bin>` to granularly replace a
symlink with the symlink from that formula would work?

Julian

Re: [homebrew] Formulae quashing symlinks

From:
Dave Bayer
Date:
2011-08-25 @ 18:12
On Aug 25, 2011, at 8:09 AM, Julian Berman wrote:

> Is there a way currently to efficiently manage formulae quashing other 
formulae's symlinks?
> 
> Specifically, I installed exuberant ctags and then a few months later 
installed emacs, only to discover that emacs had unexpectedly quashed the 
symlink for ctags with its own (GNU) ctags.

Uninstall emacs, and reinstall ctags. Or whatever, to get back to a virgin
state, before emacs mucked things up.

Using the command "brew edit emacs", after line 6 "homepage ..." add the line

	keg_only "bad citizen"

(or whatever message string you want to provide) to the formula for Emacs.
Now reinstall Emacs. Then fix whatever environment variables (PATH, 
perhaps others) you need to find Emac in Homebrew's Cellar. Usually this 
is just the bin directory, but Emacs has other support files. The Cellar 
location will be displayed during the install.

For programs and libraries that feed other programs and libraries, it's 
nice to install to a standard location such as /usr/local so the clients 
can find the stuff with no tweaking. However, for any "top of the food 
chain" program, installing using a private --prefix is usually a great 
idea. Homebrew always does this, then symlinks unless a formula is 
keg-only. Alas, keg-only is a static class attribute, not a command a 
formula can execute, and "brew unlink emacs" would come after any damage 
has already been done. 

Using Homebrew or installing by hand, requesting a --prefix build is never
a guarantee. Homebrew avoids sudo by making /usr/local user-writeable, 
which guarantees that brew installs can't muck up the system elsewhere. A 
paranoid version of this would be to have a custom user id only for 
installs, and make the --prefix directory the only place on the system 
where this user can write. Before adopting Homebrew, working with my own 
scripts I would sudo the --prefix directory user-writeable, then 
immediately revoke sudo, so installs couldn't muck up elsewhere in 
/usr/local. They'd still mark trees in my $HOME directory, alas.

One can track what any Mac install (brew or not) does by cd'ing to a log 
directory, then using the sequence

	echo >timestamp
	[engage in suspect activity]
	sudo find -x / -newer timestamp -print >snapshot.txt

Now snapshot.txt shows all the files that changed, anywhere on your system
volume. For good measure, pipe through a script that facilitates folding 
by directory when viewing in TextMate. I do this all the time. "Trust but 
verify".

Re: [homebrew] Formulae quashing symlinks

From:
Max Howell
Date:
2011-08-25 @ 18:33
On 25 Aug 2011, at 19:12, Dave Bayer wrote:

> On Aug 25, 2011, at 8:09 AM, Julian Berman wrote:
> 
>> Is there a way currently to efficiently manage formulae quashing other 
formulae's symlinks?
>> 
>> Specifically, I installed exuberant ctags and then a few months later 
installed emacs, only to discover that emacs had unexpectedly quashed the 
symlink for ctags with its own (GNU) ctags.
> 
> Uninstall emacs, and reinstall ctags. Or whatever, to get back to a 
virgin state, before emacs mucked things up.

Or just `brew unlink emacs crags && brew link ctags`

But there's nothing better for handling this yet. Not even a warning. 
Probably should be a warning at install stage.

Re: [homebrew] Formulae quashing symlinks

From:
Julian Berman
Date:
2011-08-25 @ 19:10
Thanks for the responses :).

On Aug 25, 2011, at 2:33 PM, Max Howell wrote:
> 
> Or just `brew unlink emacs crags && brew link ctags`

Yeah, this is what I did more or less.

> But there's nothing better for handling this yet. Not even a warning. 
Probably should be a warning at install stage.


So, was that a suggestion to add a warning to emacs in particular, or do 
you mean that there's plans to add something more robust to keep track of 
these things in the future?


On 25 Aug 2011, at 19:12, Dave Bayer wrote:
> 
> One can track what any Mac install (brew or not) does by cd'ing to a log
directory, then using the sequence
> 
> 	echo >timestamp
> 	[engage in suspect activity]
> 	sudo find -x / -newer timestamp -print >snapshot.txt
> 
> Now snapshot.txt shows all the files that changed, anywhere on your 
system volume. For good measure, pipe through a script that facilitates 
folding by directory when viewing in TextMate. I do this all the time. 
"Trust but verify".

This is great! I've always been putting off thinking of an intelligent way
to do that, this will work quite well. Thank you! 

Re: [homebrew] Formulae quashing symlinks

From:
Max Howell
Date:
2011-08-26 @ 09:09
On 25 Aug 2011, at 20:10, Julian Berman wrote:

> Thanks for the responses :).
> 
> On Aug 25, 2011, at 2:33 PM, Max Howell wrote:
>> 
>> Or just `brew unlink emacs crags && brew link ctags`
> 
> Yeah, this is what I did more or less.
> 
>> But there's nothing better for handling this yet. Not even a warning. 
Probably should be a warning at install stage.
> 
> 
> So, was that a suggestion to add a warning to emacs in particular, or do
you mean that there's plans to add something more robust to keep track of 
these things in the future?

I meant something more robust, but for now a caveat in emacs or ctags or 
both would be a good first step.