5929 Commits

Author SHA1 Message Date
Jack Nagel
44254aa9cf Remove redundant "which git" guards
There is always a git executable on PATH due to the git wrapper in
Library/Contributions/cmd. The wrapper will notify the user if there is
not a real git installed.
2014-07-06 14:10:52 -05:00
Jack Nagel
dae83fc895 Drop pointless string split 2014-07-06 13:52:44 -05:00
Jack Nagel
2d505754e7 Use Formula tap methods instead of matching the path 2014-07-06 13:52:04 -05:00
Jack Nagel
6e60b1d8c3 Let File.expand_path also do the join 2014-07-06 13:36:58 -05:00
Jack Nagel
7bd4f76b8c Check File.file? first to avoid second stat() 2014-07-06 13:35:44 -05:00
Jack Nagel
6a0720071e Use Formula tap methods 2014-07-06 13:16:57 -05:00
Jack Nagel
2d83c08592 Make tap_ref match similar code in update 2014-07-06 13:12:01 -05:00
Jack Nagel
f8fb74ff76 Escape paths in regexps 2014-07-06 11:25:56 -05:00
Jack Nagel
7e268670ed Just use each since we're returning from inside the block 2014-07-06 11:16:10 -05:00
Jack Nagel
c7ac8ce454 Expand ~ in PATH entries 2014-07-06 11:15:14 -05:00
Jack Nagel
32d8574d8c brew-pull: fix --install 2014-07-05 19:36:25 -05:00
Jack Nagel
9c757d6ee2 Remove remaining references to "--fresh"
This option was removed in 8cdf4d8ebf439eb9a9ffcaa0e455ced9459e1e41
because it did not do anything.
2014-07-05 19:28:50 -05:00
Jack Nagel
94c083dc2b brew-pull: combine conditionals 2014-07-05 19:16:14 -05:00
Jack Nagel
4ab696e4f2 brew-pull: avoid the "var = ... rescue nil" dance 2014-07-05 17:44:32 -05:00
Jack Nagel
01dc9c4900 brew-pull: rescue a specific exception 2014-07-05 17:30:41 -05:00
Jack Nagel
9a9328eef4 brew-pull: use diff-tree and simplify diff parsing 2014-07-05 17:26:07 -05:00
Jack Nagel
6c91c0806f brew-pull: let git-am attempt three-way merge if patch doesn't apply 2014-07-05 16:35:43 -05:00
Jack Nagel
cf4080a9e0 Remove a RUBY_VERSION check, add a FIXME comment 2014-07-05 16:01:09 -05:00
Jack Nagel
2d8a3ac35a Use popen wrapper
Closes Homebrew/homebrew#30678.
2014-07-05 15:41:22 -05:00
Jack Nagel
ad27b21cd1 Add popen wrapper that does not invoke the shell 2014-07-05 13:50:54 -05:00
Jack Nagel
84372e570e Use a regular conditional instead of next unless ... 2014-07-04 19:40:18 -05:00
Jack Nagel
810b5838b2 Simpler "use the correct symlink" checks
When determining whether to remove a symlink during unlinking, we check
three things:

  (a) Is the destination a symlink?
  (b) Does the destination exist?
  (c) Does the destination resolve to the source path?

However, since we know that the source path exists, (b) is guaranteed if
(a) and (c) are true. Thus checking (b) is unnecessary.

Similarly, when creating a new symlink during linking, we first check to
see if the link already exists by checking the same three criteria.
Again, checking (b) is unnecessary here.

See also the expanded test coverage in b52b579b.

Addendum: although we know that the source path exists during unlinking,
it doesn't matter. If the source path does not exist, then we still know
we have a broken symlink pointing into the keg we are unlinking, and
removing that symlink is still safe.
2014-07-04 17:46:52 -05:00
Jack Nagel
f666b76c39 Add more tests documenting linking behavior 2014-07-03 23:27:54 -05:00
Jack Nagel
60fc7eb0ed Avoid chdir just to make a symlink 2014-07-03 23:27:54 -05:00
Jack Nagel
083448d55d Move repeated pathname into setup 2014-07-03 23:27:54 -05:00
Jack Nagel
9e19db0dd6 Don't assign @keg twice in setup 2014-07-03 23:27:53 -05:00
Jack Nagel
4acf25a2b9 No need to silence output from Keg#link anymore 2014-07-03 23:27:53 -05:00
Jack Nagel
aad09a5a63 Option does not need to be Comparable 2014-07-03 19:29:18 -05:00
Jack Nagel
7d8a901f7a Add assert_eql to provide better failure messages for eql? tests 2014-07-03 16:55:13 -05:00
Jack Nagel
1ee4cd94ba Fix PkgVersion#<=> 2014-07-03 16:37:43 -05:00
Mike McQuaid
08c43dcd96 libspotify: migrate to homebrew/binary.
Closes Homebrew/homebrew#30632.
2014-07-03 22:33:21 +01:00
Mike McQuaid
51f387a4a2 hllib: migrate to homebrew/boneyard.
Closes Homebrew/homebrew#30631.
2014-07-03 22:33:21 +01:00
Mike McQuaid
9c5943d97a bottle: use revision to find bottle block too. 2014-07-03 22:33:20 +01:00
Camillo Lugaresi
4001c6f8f1 stop Xcode tools from overriding deps when CLT is not installed
Closes Homebrew/homebrew#30641.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-07-03 16:25:59 -05:00
Jack Nagel
b78308d2d5 Fix Formula#<=> on trunk Ruby
Arguably this method shouldn't exist and sort_by(&:name) used instead.
2014-07-03 15:00:41 -05:00
Jack Nagel
618b894c3e Replace ComparableSet with a Requirements collection 2014-07-03 14:50:57 -05:00
Jack Nagel
3ad6fc6636 Don't invoke mdfind in the tests 2014-07-03 13:02:26 -05:00
Jack Nagel
191e017d56 Add inspect to mock updater so test failures are readable 2014-07-03 12:57:16 -05:00
Jack Nagel
ef9f6ec4af Accept -s as shorthand for --build-from-source
This is experimental and will be reverted if it causes problems.

Closes Homebrew/homebrew#30392.
2014-07-02 23:15:22 -05:00
Jack Nagel
32d84377d5 Move constants so we don't have to load all of ENV to get them 2014-07-02 21:58:43 -05:00
Jack Nagel
729ee39994 Add missing require 2014-07-02 21:50:07 -05:00
Jack Nagel
2e44ffe80f Move require into method to avoid circular require
There is a nasty circular dependency here:

formula.rb
  requirement.rb
    extend/ENV.rb
      extend/ENV/shared.rb
        formula.rb

Probably the information that the build environment needs from formula
should be passed in at runtime, but that seems hard and I really just
want to be able to run the tests with warnings turned on. :/
2014-07-02 21:27:19 -05:00
Jack Nagel
cabc451ca8 Add min_version to X11Dependency inspect string 2014-07-02 15:45:24 -05:00
Jack Nagel
9106f221cb Add regression test for decf7acced44bb156ba18677f55609b19ff6ca5a 2014-07-02 15:22:32 -05:00
Jack Nagel
4cbae37d62 Don't expose the dependency cache data structure 2014-07-02 15:15:59 -05:00
Jack Nagel
07e00061a7 Pass relative paths into link exceptions 2014-07-02 10:48:18 -05:00
Jack Nagel
fbe8dc8fc6 Add a test that exercises the code in X11Dependency#satisfied? 2014-07-02 00:25:01 -05:00
Jack Nagel
4743105216 Fix typo 2014-07-01 23:56:00 -05:00
Jack Nagel
330e18bb17 Use predicate methods instead of inspecting the tags array 2014-07-01 21:57:30 -05:00
Jack Nagel
177eee419a Replace find_all + each with grep 2014-07-01 21:39:15 -05:00