This code makes assumptions about the existence of prefix which are
valid in the context of the installer, but not necessarily in the
context of `brew info`, thus `brew info` on an outdated formula errors
out.
This reverts commit e5b53dd64b769b67805d1054d906f7083939d905.
Output JSON with the --json=v1 option. Output is in an array, and
supports one or more formulae (or all, with the --all option).
Why 'v1'? The format is unstable, presumably we'll deprecate it
someday. It should be solid by Homebrew 1.0.
ClosesHomebrew/homebrew#13299.
conflicts_with is a thin wrapper around Requirement which simplifies
marking conflicts between formulae.
ClosesHomebrew/homebrew#13687.
Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
The URL being constructed is only able to extract the correct username
when git@ or https:// URLs are found as the origin remote. This change
allows git:// to be used as well.
Signed-off-by: Maurice Kelly <osv-github@chatswood.org.uk>
ClosesHomebrew/homebrew#11670.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Tapped formulae that dupe those in core now display the correct URL when
invoked like `brew info homebrew/dupes/openssl`.
This also fixes the broken `brew info` test.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
We mark the linked keg with an asterisk when multiple kegs exist, but
not when there is only a single keg. Start marking even in this case,
giving consistent behavior and a reliable indicate of the link status.
FixesHomebrew/homebrew#11300.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
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.
When multiple kegs are installed, `brew info` marks a keg with an
asterisk if f.installed_prefix == keg, but this is only true if either
HEAD or the newest version of the formula is installed. This isn't
always useful, so let's mark the currently linked keg with an asterisk
regardless of the version.
Obviously, keg-only formula will never be marked, but this is probably a
feature. When multiple keg-only kegs exist, chances are that they are
each being utilized by something, so there isn't really a "used" and
"unused" version.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
`rack` is a commonly used alias for `formula.prefix.parent`---so common that it
gets defined and used quite a bit. This patch makes `rack` an official method
of the `Formula` class.
The git command now uses --git-dir instead of --work-tree.
Using --work-tree won't work if you are inside another Git repository.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
The code was sucking. To the extent that maintenance was hard. It's a lot
easier to work with code that is sensibly split at sensible boundaries. So
now it is more like that.
But the refactor is minimal. Because we don't want you to have more merge
hell than absolutely necessary.
If you merge you will need to pay attention to brew.h.rb (as it is deleted)
and bin/brew (as command logic is gone). It will be painful, but you will just
have to help git out by moving any changes around manually.
Note compatibility.rb. It ensures that any function renames or removals don't
break anything. We're pretty serious about backwards compatibility. And that's
because we encourage you to hack around with the innards. And we couldn't do
that if we would then just make stuff disappear behind your back.