keg_relocate: fix ordering of replacements
This commit is contained in:
parent
8d5df2ea87
commit
d60020f1a9
@ -66,7 +66,14 @@ class Keg
|
|||||||
relocation.old_repository => relocation.new_repository,
|
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)
|
changed = s.gsub!(regexp, replacements)
|
||||||
|
|
||||||
next unless changed
|
next unless changed
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user