Relocate HOMEBREW_LIBRARY conditionally
Relocate HOMEBREW_LIBRARY conditionally when HOMEBREW_PREFIX = HOMEBREW_REPOSITORY.
This commit is contained in:
parent
4edf28409d
commit
65b9e1231d
@ -74,13 +74,16 @@ class Keg
|
||||
s = first.open("rb", &:read)
|
||||
|
||||
replacements = {
|
||||
relocation.old_prefix => relocation.new_prefix,
|
||||
relocation.old_cellar => relocation.new_cellar,
|
||||
relocation.old_library => relocation.new_library,
|
||||
relocation.old_prefix => relocation.new_prefix,
|
||||
relocation.old_cellar => relocation.new_cellar,
|
||||
}
|
||||
# when HOMEBREW_PREFIX == HOMEBREW_REPOSITORY we should use HOMEBREW_PREFIX for all relocations to avoid
|
||||
# being unable to differentiate between them.
|
||||
replacements[relocation.old_repository] = relocation.new_repository if HOMEBREW_PREFIX != HOMEBREW_REPOSITORY
|
||||
if HOMEBREW_PREFIX == HOMEBREW_REPOSITORY
|
||||
replacements[relocation.old_library] = relocation.new_library
|
||||
else
|
||||
replacements[relocation.old_repository] = relocation.new_repository
|
||||
end
|
||||
changed = s.gsub!(Regexp.union(replacements.keys.sort_by(&:length).reverse), replacements)
|
||||
next unless changed
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user