diff options
| author | Josh Hagins | 2016-11-01 15:21:13 -0400 |
|---|---|---|
| committer | GitHub | 2016-11-01 15:21:13 -0400 |
| commit | f14a3a17decdcfd26fc9f2dc0958ee642241ea5a (patch) | |
| tree | b8845ac321b26b7e86400f391829df4ab230b966 | |
| parent | 8d5df2ea8769f48fc8b9c145abc8fc1329a650cb (diff) | |
| parent | e57d312ad1caa09ca0cd7cc4727dfd4b247d9971 (diff) | |
| download | brew-f14a3a17decdcfd26fc9f2dc0958ee642241ea5a.tar.bz2 | |
Merge pull request #1420 from jawshooah/fix-relocate
keg_relocate: include hard links and fix replacement ordering
| -rw-r--r-- | Library/Homebrew/keg_relocate.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Library/Homebrew/keg_relocate.rb b/Library/Homebrew/keg_relocate.rb index 41686b1bb..0ab4b9731 100644 --- a/Library/Homebrew/keg_relocate.rb +++ b/Library/Homebrew/keg_relocate.rb @@ -66,11 +66,18 @@ class Keg relocation.old_repository => relocation.new_repository, } - regexp = Regexp.union(replacements.keys) + # Order matters here since `HOMEBREW_CELLAR` and `HOMEBREW_REPOSITORY` are + # children of `HOMEBREW_PREFIX` by default. + regexp = Regexp.union( + relocation.old_cellar, + relocation.old_repository, + relocation.old_prefix + ) + changed = s.gsub!(regexp, replacements) next unless changed - changed_files << first.relative_path_from(path) + changed_files += [first, *rest].map { |file| file.relative_path_from(path) } begin first.atomic_write(s) |
