Let's choose the first \d{2,} as the build number, as it is the most
likely to indicate significant changes, and we need something to use for
comparison when selecting compilers.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This is silly, but I am no Rubyist and I don't have time to
figure out why Formula.factory(foo).url works as expected but
Formula.factory(foo).version does not.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This will be useful for shell tab completion when something like `brew
install <formula> --version <version>` is implemented.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Rather than regex the output of `git show <rev>:<path>`, we write the
output of `git cat-file blog <rev>:<path>` to a temporary file, and then
operate on it just as we would a normal formula.
I haven't observed any speed difference. `git cat-file blob` is faster
than `git show`, but the "slow part" is still the git-rev-list
invocation. But really it's pretty fast overall.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
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>
Current warnings contain a mix of variable names with a '$' prefix and
without; most documentation omits the '$', so drop it.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This can be made more robust in the future when we stop throwing away
the ':build' type flag in Formula#depends_on.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Should help advert confusion surrounding the "could not find gcc 4.2.x" message
recieved by Lion users running the latest version of XCode.
FixesHomebrew/homebrew#8876.
Previously, stripping arguments like `--HEAD` for dependencies failed because
that flag affects the installation prefix encoded into formula objects. The
previous implementation of `ARGV` filtering tried to contain all changes to a
single method call before the `FormulaInstaller` forks. This update spreads
things out a bit:
- The Homebrew `ARGV` extension adds a new method, `filter_for_dependencies`
which strips flags like `--HEAD`, yields to a block, then restores the
original contents of ARGV.
- The `explicitly_requested?` test, which returns true or false depending on
if a formula object is a member of `ARGV.formulae`, is now a method of
`Formula` objects.
- `FormulaInstaller` objects now execute the installation of dependencies
inside an `ARGV.filter_for_dependencies` block if the dependency was
`explicitly_requested?`.
FixesHomebrew/homebrew#8668.
ClosesHomebrew/homebrew#7724.
This ended up being noise for some users. We need a better set of steps
to trigger the bug in order to create a good doctor check; patches
welcome from users who are encountering this issue.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
The recommended compiler versions printed from `brew-config` are out
of date and misleading. The recommendation is always "Run the latest
version of Xcode available for your platform".
`brew options --installed` will now "do the right thing".
There is getting to be a small but noticeable amount of code duplication
among commands that take options like "--installed" or "--all"; it may
be worth factoring this out into a method that will return a collection
of formula objects based on the options that are passed.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Running brew doctor creates a temporary directory in $HOMEBREW_TEMP or
/tmp but does not clean it up afterwards. This patch deletes the
directory created to prevent polluting $HOMEBREW_TEMP or /tmp with empty
directories.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
We don't want single letter options like '-v' or '-d' to unintentionally
trigger formula-specific options.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>