1319 Commits

Author SHA1 Message Date
Jack Nagel
c1fecab365 Don't return nil from Formula#linked_keg
Doing so was the result of a quick hack to fix the "deps installed as
upgrades don't get linked" bug, but it was a mistake. Instead, always
return the LinkedKegs entry as a Pathname object, and let callers be
responsible for checking that it exists.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 23:52:01 -06:00
Jack Nagel
ddde478f63 Be gentle when stdout is not a tty
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 17:54:35 -06:00
Jack Nagel
c5592b83b2 Pathname: silence install-info output
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 13:02:47 -06:00
Jack Nagel
46b80bd552 Revert "install: unlink old kegs"
This reverts commit 2eabe2cbc84649696aeb6fa842a70f3794955597.

When Keg#unlink looks for symlinks relative to the keg, it can hit false
positives that actually belong to a different keg and unlink them
anyway. This breaks our "force identical directory symlinks to be shared
real directory" case.

This may be a problem in general with the unlinking code and should be
investigated.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 12:58:24 -06:00
Jack Nagel
511598fa37 install: unlink old kegs
If a formula makes it all the way to the actual install step, it is safe
to unlink the keg before linking; this will prune dead symlinks in the
case where a keg was removed with `rm -rf <keg>` but not unlinked with
`brew unlink`.

Fixes Homebrew/homebrew#10077.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-10 08:57:11 +00:00
Adam Vandenberg
6cfe4b3208 Allow multiple arguments to install 2012-02-09 19:16:49 -08:00
Mike McQuaid
27ecdb4266 Split bottle logic.
Fixes Homebrew/homebrew#8805.
2012-02-09 21:05:17 +00:00
Adam Vandenberg
469ad7bee5 this was out of balance 2012-02-08 21:58:46 -08:00
Adam Vandenberg
c42a6b6802 Pathname: support .tar.Z extension 2012-02-08 21:08:18 -08:00
samueljohn
0eb1cadee0 brew --config: properly handle empty which strings
Symptom: If no python/ruby/perl is in your path, then `which x`.chomp
returns an empty string and `unless ""` is still true.  So, N/A is never
displayed.  Instead, ruby's Pathname.new("").realpath returns the cwd.
(I consider this realpath behavior a ruby bug) Fix: use empty?

Closes Homebrew/homebrew#10027.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-08 14:41:55 -06:00
Jack Nagel
9e8da81302 doctor: try to detect osx-gcc-installer
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-08 11:51:51 -06:00
Jack Nagel
a743f8d862 create: homepage comes before url and checksum
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-06 17:19:54 -06:00
Adam Vandenberg
fe6ab92857 Split some classes to formula_support
formula.rb is getting big, let's start splitting things out.
2012-02-04 18:45:08 -08:00
Jack Nagel
e251e5e4ec Adjust ARGV tests
ARGV.kegs and ARGV.formulae no longer raise exceptions.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-04 00:34:22 -06:00
Jack Nagel
1a3a1249bf Warn the user of required arguments
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-04 00:27:05 -06:00
Adam Vandenberg
7ed76725c4 uses: do nothing if no args 2012-02-03 21:40:15 -08:00
Adam Vandenberg
95f1d330b2 don't complain if args are empty 2012-02-03 21:40:14 -08:00
Jack Nagel
709674cb95 Move old ENV.use_foo? compiler methods to compat
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-03 23:01:28 -06:00
Adam Vandenberg
d312a54d46 Remove aka warning 2012-02-03 20:02:41 -08:00
Jack Nagel
3001391a5d Add and use plist helper methods
These will be used to unify the label namespaces in embedded plists,
i.e. 'homebrew.mxcl.<formula>'.

plist_path returns the full path to a plist file located at the top
level of the keg; plist_path.basename can be used if just the filename
is needed.

c.f. Homebrew/homebrew#9346.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-03 19:50:58 -06:00
Jaeho Shin
1647a8d93e Suppress output of which commands
Added missing -s option to which for hg, bzr, fossil.

Closes Homebrew/homebrew#9954.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-03 12:22:09 -06:00
Adam Vandenberg
8fe17772bb Show which Perl, Python and Ruby are in the path. 2012-02-02 19:10:56 -08:00
Misty De Meo
706da00b72 doctor: remove gcc-4.2 warning on Xcode 4.2+
Re: Homebrew/homebrew#9925, many others.
2012-02-02 14:08:49 -06:00
Misty De Meo
b6fa08f2d2 devel: reset mirrors when building devel
Otherwise stable mirrors will be considered when the devel download
fails.

Fixes Homebrew/homebrew#9910.
2012-02-02 13:13:07 -06:00
Jack Nagel
4ce8bdb32c prune: remove info dir entries for pruned files
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-01 22:52:15 -06:00
Jack Nagel
8567570d97 keg: make locale directory regexp a constant
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-01 22:52:14 -06:00
Jack Nagel
59458eac51 link: add missing newline in verbose mode
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-01 22:52:14 -06:00
Nicolas Despres
d0be4d692b keg: handle the info directory file properly
If HOMEBREW_KEEP_INFO environment variable is set:
 - Do not symlink the info directory file (aka 'share/info/dir')
   otherwise it gets overwritten by next installed brew.
 - Install an entry in the directory for each linked info file when the
   brew is linked.
 - Uninstall the entry when the brew is unlinked.

Closes Homebrew/homebrew#9700.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-01 22:52:14 -06:00
Nicolas Despres
212927ee54 Pathname: remove trailing spaces
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-01 22:16:47 -06:00
Colin Hebert
5cc4b1c991 CVSDownloadStrategy: correctly stage all files
The FileUtils.cp_r function with a wildcard doesn't copy hidden files
(starting with a dot) Instead of copying everything selected by *,
select all the folder content.

See: http://www.ruby-doc.org/core-1.9.3/Dir.html#method-c-glob

Closes Homebrew/homebrew#8873.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-01 21:18:39 -06:00
Jack Nagel
36085bd34d keg: mkpath directories in share/locale
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-01 14:17:33 -06:00
Jack Nagel
66388b7a43 create: punt on bad URLs
When we can't detect a name from the URL, just ask the user.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-31 17:57:20 -06:00
Jack Nagel
a86f524156 mkpath directories under lib/ocaml
Ocaml packages that need to install here will cause the site-lib
directory to be created, and the symlink in the ocaml keg will work as
intended. This is necessary for the ocaml bottle to work properly.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-30 00:04:33 -06:00
Jack Nagel
8809c85cc3 versions: ignore NameError and ArgumentError
Fixes Homebrew/homebrew#9856.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-29 16:00:27 -06:00
Mike McQuaid
c07ca9e56d Bottles should care about cellar and prefix 2012-01-29 20:08:08 +00:00
Mike McQuaid
5508acc139 Bottles should care about cellar path not prefix.
Closes Homebrew/homebrew#9844.
2012-01-29 13:03:35 +00:00
Adam Vandenberg
62cfa49082 audit: make boost-jam a build-time dependency 2012-01-28 12:50:45 -08:00
Jack Nagel
8944cc6b66 versions: fix up error handling
Now we handle some things more explicitly and in the process get rid of
the blanket rescue on the mktemp block, which is something of an
antipattern.

By unloading the class *after* determining the version, we avoid the
case where the class had previously been unloaded but Formula.factory
failed, and trying to unload the nonexistent class results in a
NameError. Doing it this way, we avoid having to rescue NameError and
thereby avoid hiding other cases where it may occur.

We also rescue TypeError which gets us past a few more bad formula in
the history in some instances.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-27 03:40:24 -06:00
Jack Nagel
d10f2afbac versions: silence 'aka' warning and syntax errors
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-26 23:02:18 -06:00
Konstantin Shabanov
b695dfb18c Strip escaping from query
Regexp#source retains escape sequences as is, so searching for formulae
like 'pure-ftpd' doesn't work.

Closes Homebrew/homebrew#9597.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-26 18:21:26 -06:00
Jack Nagel
ab19242d04 audit: reorganize some checks
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-25 22:41:53 -06:00
Jack Nagel
c36561f450 audit: make devel check more specific
There are a few false positives where the string 'devel' occurs in other
contexts.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-25 22:39:13 -06:00
Misty De Meo
d121bcdada Add devel to the DSL, + stable and bottle blocks
This commit adds a `devel` entry to the DSL, allowing formulae to
specify an unstable branch.

`devel` takes a block, which should contain standard `url` and `md5`
fields (and `version`, if necessary). This must come after the standard
DSL fields.

This commit also migrates over all formulae currently using `devel` to
the new syntax, as well as formulae which used `head` for non-VCS urls.

The new syntax is also available for `stable` and `bottle`. `stable` is
an option alongside the old syntax. `bottle` replaces the old syntax.

Note that the @stable ivar in Formula has been renamed to @standard,
and the @bottle ivar has been renamed to @bottle_url.

Closes Homebrew/homebrew#9735.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2012-01-25 21:45:19 -06:00
Jack Nagel
b3092ea3f7 Fix failing ENV tests
We need the ARGV extension now that we call ARGV.build_bottle? in
set_cpu_cflags.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-25 21:20:13 -06:00
Jack Nagel
c94e8b380f doctor: reset should be done in HOMEBREW_REPOSITORY
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-24 19:59:24 -06:00
Mike McQuaid
ab31e50574 Make brew doctor reset instructions clearer.
Fixes Homebrew/homebrew#9739.
2012-01-24 19:36:10 +00:00
Dylan Smith
66fbb607fd versions: don't print 'nil' when stdout is not a tty
Closes Homebrew/homebrew#8960.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-24 12:21:08 -06:00
Adam Vandenberg
2d4d0c4655 Rubyisms 2012-01-23 19:29:55 -08:00
Jack Nagel
0f499ac7be Don't append an empty value to CFLAGS
Appending an empty string results in an extraneous space character.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-19 22:54:28 -06:00
Jack Nagel
cf16987845 audit: check for mercurial dependency
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-01-17 21:57:13 -06:00