The print wrapper which has its own `puts` broke this line; though with
the changes to `link` it isn't necessary any longer, so just remove it.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
If the link already exists exactly (well almost exactly) as we are about to correct it, then it's okay. Otherwise we error out. This is a safe choice, and really, the correct choice too.
This will prevent the tickets like Homebrew/homebrew#11050 from occurring.
Refs http://stackoverflow.com/questions/9762943
The system ln no longer outputs anything. Though the user can force its output with a --verbose of course. So in cases where it's not the usual of: not writable or existing file, we can ask the user to run with --verbose. I don't particularly like hiding its output, but it just confused the error IMO since it is creating a relative symlink the output was weird every time I've seen it in tickets.
I made a print wrapper so that the brew-link output doesn't get mucked up if an exception is thrown.
We allow homebrew/dupes for instance, rather than Homebrew/dupes. Because nobody likes shifting in the terminal.
In the process of doing this I discovered some case-insensitive filesystem bugs we have avoided before because I had the foresight to mandate lowercase in formula names. GitHub considers Homebrew and homebrew to be different (even though you can't create both). So we had to allow case insensitivity in tap input. I have made it now so the resulting directory however is lowercased, neatly avoiding the issue. And so we also downcase tap arguments when applying them to tap directories or formula.
For when the symlink for a tap already exists and points to the thing we are about to symlink. This can happen, mostly because my code has sucked, but since the filesystem can be edited by the user at whim, it's possible then too.
Fixes:
$ brew tap adamv/alt
...blah blah blah..
$ brew tap josegonzalez/php
...blah blah blah...
Warning: Could not tap josegonzalez/php/php over mxcl/master/php
Where it should be "over adamv/alt/php".
This means `brew search` always does some network operations. Which is a shame, but I think (for brew) fine. Probably the no-connectivity handling needs to be improved.
Note I removed some of the code that changed the URL to be that of the github.user. Because this doesn't make any sense really. We want people to reference the commit history for whatever fork of homebrew they have checked out. So this is now what it does.
Rationale: well, it should always have been like this!
However now we are opening ourselves up to more-mixed installations of formula not maintained by us, it's important that
The reason it didn't work is it doesn't use ARGV.formulae because it needs to be able to edit stuff that doesn't parse. Most other stuff already works because we are awesome.
The symlinks taps write to Formula show up in git status, but this trick prevents this. brew-(un)tap maintain a .gitignore in Formula that contains all the symlinks brew-tap creates.
We add the .gitignore to the root .gitignore and TADA! Magic.
Commit ee2c3ab ("Remove spurious libiconv dependencies") pruned all
existing "depends_on 'libiconv'" usages from Homebrew in preparation for
removing the libiconv dupe itself.
Now that is done, and we can remove and blacklist it. It can be obtained
from Homebrew-alt.
ClosesHomebrew/homebrew#10464.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Homebrew itself is found under HOMEBREW_REPOSITORY,
which *may* be the same HOMEBREW_PREFIX, but does not have
to be if you link brew into /usr/local/bin from another location.