Previously, `outdated_brews` returned a list of lists---each containing three
components of a Formula object:
- f.rack
- f.name
- f.version
Frequently more information is required which necessitates back-casting from
`name` to a Formula object---simpy returning formula objects removes this step.
`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.
When installing with --HEAD, cached repo clones do "git fetch origin"
followed by "git reset --hard". This will only reset the working tree
and index to the state of the local HEAD, but Homebrew will think it's
updated and install anyway. "git reset --hard origin/master" will
achieve the desired result.
Should fixHomebrew/homebrew#7613.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Otherwise, for formula that making the very first install into `sbin`, the
following line will fail with a critical error:
bin = (HOMEBREW_PREFIX/bin.basename).realpath.to_s
Because `sbin` will not exist until after `link` runs.
This isn't very clean as it moves `check_PATH` away from the other checks in
`caveats`, but I couldn't think of a better hotfix that did not require a bit
of code shuffling and re-writing.
`brew-unpack` now runs `Formula.brew` and copies the stage directory to the
unpack location. This provides two improvements:
- Patches may be applied. The `patch` metho of the Formula class is
overloaded such that patches are only applied if the `--patch` option is
passed to `brew unpack`.
- Formula can respond better to flags passed by `ARGV`.
Some trickery is pulled to ensure `DATA` is correctly set for each unpacked
formula.
`brew options --installed` will print options for formulae that are
already installed.
ClosesHomebrew/homebrew#7565.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
`git status -s` would spit out "fatal: not a git repository" when not in
HOMEBREW_PREFIX or a child directory of HOMEBREW_PREFIX. Specify a
git-dir and work-tree to fix this.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
The compiler setting in the xcodeproj is overridden by the CC setting in the environment. This is a bit insane IMO since the xcodeproj itself has detailed decisions about what tools to use.
FixesHomebrew/homebrew#6406.
Document the '--versions' option for `brew list`.
The two forms of the `list` command as previously documented clearly do
different things, but after documenting '--versions', their functions do
overlap a bit, so we combine them and clarify the different invocations.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
- Remove unnecessary linefeeds above "ENVIRONMENT"
- Use the word "example" rather than "sample" to be more consistent
throughout the documentation
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This is used with fails_with_llvm so that if GCC cannot be found (and we suspect this is the case with Xcode 4.2) the build will fail.
Quite possibly it should be the default.
Look in /usr/bin because all versions of Xcode install it to /usr/bin now and this allows us to support Xcode-less installs of Apple's developer tools.
I inadvertently gzipped it last night. That in itself doesn't cause any
tests to fail because the download strategy code is robust, but it's
fixed here anyway to be consistent. Basically, I'm dumb.
I also took the opportunity to remove the other resource fork file, so
the tarball is clean.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
FixesHomebrew/homebrew#7329.
FixesHomebrew/homebrew#7269.
FixesHomebrew/homebrew#7236.
Also quite a lot of tidy. This should all work fine.
I think we only started referring into xcode_prefix because LLVM used to not
be linked into /usr/bin. But for sure this is no longer true. If someone out
there doesn't link cc etc. into /usr/bin then I guess we can revise this patch
but it's not something we officially supported before, it was just an
accident.
I added a test step in the init code so that a working compiler will always be
selected. This is mainly a fallback for old Xcodes. Though a comment in
another area of the code suggested Xcode 3 on 10.5 doesn't have LLVM so…
The test_a_basic_install was failing because it expected
libexec.children.length to be 1, when in fact there were two files in
the untarred libexec: NOOP, and the Mac OS X resource fork file ._NOOP.
That file is now removed, and the test passes.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
`brew fetch --force` was a no-op for formula pathnames when that formula
did not exist in Library/Formula, because `brew --cache #{f.name}`
results in an error for that case.
Fix it by always using f.cached_download.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
`svn up` doesn't take url argument; compare `svn help up` to `svn help checkout`
Apparently `svn up` can ignore this argument (not documented), but providing this
argument could confuse code readers into believing that changing the url will
switch the branch. It doesn't; the argument is ignored.
This fix was relayed to me, but I've studied it further before posting.
It is related to the bug where --HEAD installs reuse the wrong cache.
Reading the former code, one might hope that providing a changed URL would
have `svn up` change branches. It doesn't; the url was ignored.
ClosesHomebrew/homebrew#7159.
Signed-off-by: Max Howell <max@methylblue.com>