Skip to content
Snippets Groups Projects
Commit d60020f1 authored by Josh Hagins's avatar Josh Hagins
Browse files

keg_relocate: fix ordering of replacements

parent 8d5df2ea
No related branches found
No related tags found
No related merge requests found
......@@ -66,7 +66,14 @@ 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment