246 Commits

Author SHA1 Message Date
Mike McQuaid
1f48e17f1b rubocop: fix brew style warnings. 2018-01-17 10:42:43 +00:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Mike McQuaid
01e9ec9a9f Rubocop: automatic rule fixes. 2017-09-24 21:23:59 +01:00
Mike McQuaid
e862bcbc32 keg: cleanup aliases correctly.
This was missed when I was focused on cleaning up versioned aliases.

Fixes #2992.
2017-08-05 18:03:04 +01:00
Mike McQuaid
1651647a3d keg: correctly cleanup old aliases.
Cleanup old, versioned aliases and tap aliases folders when unlinking
or uninstalling a keg.
2017-07-28 11:41:12 +01:00
Markus Reiter
2d6ae61314 Re-revert "Fix operator spacing." 2017-06-02 19:22:05 +02:00
ilovezfs
197392b56d Revert "Fix operator spacing." 2017-06-01 04:06:40 -07:00
Markus Reiter
d34ba7395b Fix operator spacing. 2017-05-31 19:53:41 +02:00
Mike McQuaid
7a38bab333 Fixup all RuboCop warnings. 2017-05-29 18:43:18 +01:00
Markus Reiter
060af0a26a Rename FormulaLock to LockFile. 2017-05-25 06:18:52 +02:00
Mike McQuaid
76f48d338e keg: skip opt versioned aliases for devel/head.
These versioned aliases don’t correspond to the correct version if not
Installed from stable.

Fixes #2596.
2017-05-09 15:10:57 +01:00
Mike McQuaid
82858176f0 keg: correctly remove alias symlinks.
Fixes #2427.
2017-04-01 16:33:24 +01:00
Alex Dunn
00af5250f0 caveats: combine completion and function messages
Fixes https://github.com/Homebrew/homebrew-core/issues/10338.

Closes #2287.

Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
2017-03-19 16:32:23 -07:00
Mike McQuaid
4991039809 keg: resolve rack aliases correctly.
Don't use the basename but instead use the Formulary logic for rack
formula resolution.

Fixes #2288.
2017-03-08 08:51:41 +00:00
Naoto Kaneko
ccc9b2dc6d Check for metafiles only in the root directory 2017-02-24 17:44:27 +09:00
Naoto Kaneko
d4df9d44e0 Exclude executables from metafiles
Exclude executables in #empty_installation? to avoid 'Empty
Installation' error when only executable which name is the
same as one of metafiles is installed.
2017-02-23 16:49:14 +09:00
Mike McQuaid
1ea79cd0b3 keg: handle missing alias opt link on uninstall.
Fixes an issue introduced in #1192 where there would be a failure if the
alias link didn't exist on removal (which would be the case for anything
with an alias installed before #1192 was merged).
2017-02-21 18:31:34 +00:00
Mike McQuaid
dfa2c247e0 keg: simplify code, handle exceptions. 2017-02-20 14:23:01 +00:00
ilovezfs
63295fd81a have opt alias symlink point into the Cellar
in case people expect to be able to find the prefix by only resolving
the symlink once (e.g., if they're using readlink not realpath)
2017-02-20 14:14:04 +00:00
ilovezfs
4c922a089b remove unless empty since each is no-op for empty 2017-02-20 14:14:03 +00:00
ilovezfs
14ef15f591 keg: create symlinks in opt for formula aliases 2017-02-20 14:14:03 +00:00
Markus Reiter
94dceeab1d Move require_relocation? from os/mac/keg to keg. 2017-02-11 13:43:00 +01:00
ilovezfs
67bdeb463a Revert "Use Open3 for integration tests instead of manually forking." 2017-02-10 19:28:40 -08:00
Markus Reiter
cedc46c64b Use false instead of # no-op. 2017-02-09 18:40:20 +01:00
Markus Reiter
956daf37a0 Use Open3 for integration tests instead of manually forking. 2017-02-09 17:17:48 +01:00
Alyssa Ross
245944d359 keg: use Forwardable to methods delegated to #path 2017-01-19 17:06:38 +00:00
Alyssa Ross
34e13fc527 keg: don't conditionally switch alias target
This seems to be a remnant of Ruby 1.8.
2017-01-19 17:06:38 +00:00
Mike McQuaid
c0a29d6644 caveats, keg: remove linkapps caveats code. 2017-01-09 14:10:26 +00:00
Mike McQuaid
4497190593 keg: use resolved_path not realpath.
This guards against this being a non-symlink in which case it will fail.
2017-01-06 16:35:41 +00:00
Mike McQuaid
fc11f633b2 Merge pull request #1677 from MikeMcQuaid/formula-prefix-opt
formula: make prefix usually return opt_prefix.
2017-01-03 20:10:22 +00:00
Alyssa Ross
e4856143a6 keg: check installed dependencies iff optlinked 2017-01-01 14:27:24 +00:00
Alyssa Ross
94ead55772 keg: keg_only kegs can have installed dependents 2017-01-01 14:26:28 +00:00
Alyssa Ross
05b85a7bef keg: update installed dependency resolution
Closes #1525. (See there for a motivation for this change.)
2017-01-01 14:26:28 +00:00
Alyssa Ross
8b30abe060 keg: handle dependencies of moved/renamed formulae
In #1497 I switched from Keg#to_formula for comparing kegs to formulae
to comparing the name and tap in the keg's tab to the name and tap of
the formula.

However, this fails to match if the name and tap of the formula have
changed since the keg was installed, so it's clearly better to use
Keg#to_formula where possible, and fall back to the information in the
tab when #to_formula can't be used.
2016-12-31 17:53:06 +00:00
Mike McQuaid
33fbf3f32d Merge pull request #1750 from alyssais/fallback_dependencies
keg: fall back for dependencies of buggy tabs
2016-12-31 17:34:55 +00:00
Mike McQuaid
1c9651f04f Merge pull request #1756 from alyssais/nil_dependents
keg: don't return nil dependencies
2016-12-31 17:34:17 +00:00
Mike McQuaid
a571965df9 formula: make prefix usually return opt_prefix.
Return `opt_prefix` if it exists and `prefix` is not called from within
the same formula's `install` or `post_install` methods. Otherwise, fall
back to the existing functionality.

This avoids the need to use `opt_prefix` etc. everywhere and generally
means we don't expose an implementation detail (i.e. the full Cellar
path) to dependents that have a habit of hard-coding it.
2016-12-31 16:38:05 +00:00
Alyssa Ross
fb920668c8 keg: don't return nil dependencies
This is a proper fix to the problem addressed by #1510.

The problem arises when f_kegs is nil, which can happen if the name and
tap used to install a keg don't match the name and tap currently
associated with its formula (i.e. if it's been renamed or moved).
2016-12-31 14:16:38 +00:00
Alyssa Ross
b0a38c06bf docs: improve Keg.find_some_installed_dependencies
See https://github.com/Homebrew/brew/pull/1752#discussion_r94257147
2016-12-30 22:22:13 +00:00
Alyssa Ross
d998a3fcce tab: remove #reliable_runtime_dependencies?
See https://github.com/Homebrew/brew/pull/1750#discussion_r94243825 for
discussion.

Removes Tab#reliable_runtime_dependencies? in favour of returning nil
from Tab#runtime_dependencies if the list is unreliable.

Because Homebrew 1.1.6 hasn't been tagged yet, tabs created in tests
aren't created with a homebrew_version that marks the
runtime_dependencies in the Tab as reliable, so there are some tests
that fail. To work around this, I've had to add a line to some tests
that explicitly overrides the homebrew_version in the Tab. This is
really ugly though, so they should be removed as soon as possible after
1.1.6 is released.
2016-12-30 20:34:14 +00:00
Alyssa Ross
01e1f7d49e keg: fix fallback dependencies with multiple kegs
Fixes #1524.
2016-12-30 18:41:14 +00:00
Alyssa Ross
e5db7927c9 keg: fall back for dependencies of buggy tabs
Fixes #1554.
2016-12-30 16:16:53 +00:00
Alyssa Ross
3a27d81219 keg: fix dependents with unavailable formulae
Because of an accidental use of `=` instead of `==`, the source formula
check would be skipped when determining if a keg depended on another one
(so only the versions would be compared).

Fixed that comparison, and updated the corresponding test.

Glad I caught that!
2016-12-27 22:58:44 +00:00
Alyssa Ross
e5d7e13c63 keg: installed dependencies of unknown formulae
Previously, trying to resolve the dependencies of a keg would raise an
exception if the formulae for any of the dependencies could not be found
(e.g. if it had been moved to another tap).

This commit updates the dependency finding logic to catch these
exceptions, and fall back to comparing names and taps of formulae, which
should give the correct behaviour.

Fixes #1586.
2016-12-27 18:03:05 +00:00
Mike McQuaid
c317c3c31f Merge pull request #1616 from zachwhaley/zsh_functions_caveats
caveats: Differentiate zsh completion files and function files
2016-12-12 13:27:40 +00:00
Mike McQuaid
11483d55c9 keg: also prune opt.
If there's dead symlinks in there they should be removed.
2016-12-11 11:55:07 +00:00
Zach Whaley
14f46625a3 caveats: Differentiate zsh completion files and function files
When installing a file to zsh/site-functions directory, it is assumed this is a zsh completion file,
and the zsh completion caveat is printed after installation.

But not all files in the zsh/site-functions directory are completion files.
Some are files for functions that can be loaded on demand with zsh's autoload command.

- Edit Keg.completion_installed to search specifically for files in the zsh/site-functions
  directory starting with an underscore only (By convention, zsh completion files start with an underscore)
- Add Keg.zsh_functions_installed to search for non-completion files in the zsh/site-functions
- Add Caveats.zsh_function_caveats to print a caveat if non-completion files have been installed
  to zsh/site-functions
2016-12-08 07:23:26 -06:00
Zach Whaley
1995f65308 Add a method for installing fish function files
Fish shell allows third-party software vendors to put their own function files in a directory for their software.
For brew installed Fish shell, this is /usr/local/share/fish/vendor_functions.d
2016-12-04 13:21:42 -06:00
Alyssa Ross
f7f72093a8 keg: don't rely on #to_formula
It doesn't always work.
For example, a keg could have been installed with a formula from a
URL, which Homebrew now does not know how to access.

Fixes #1496.
2016-11-13 23:20:38 +00:00
Alyssa Ross
bb30b01d5d uninstall: go easier on the integration tests 2016-10-25 23:53:59 +01:00