language/python: avoid modifying all Python symlinks
Homebrew Python will always have a realpath in HOMEBREW_CELLAR. Instead, check if the symlink target points to HOMEBREW_CELLAR.
This commit is contained in:
parent
4482e25cb2
commit
0e8db0155a
@ -330,8 +330,9 @@ module Language
|
|||||||
# Robustify symlinks to survive python patch upgrades
|
# Robustify symlinks to survive python patch upgrades
|
||||||
@venv_root.find do |f|
|
@venv_root.find do |f|
|
||||||
next unless f.symlink?
|
next unless f.symlink?
|
||||||
next unless (rp = f.realpath.to_s).start_with? HOMEBREW_CELLAR
|
next unless f.readlink.expand_path.to_s.start_with? HOMEBREW_CELLAR
|
||||||
|
|
||||||
|
rp = f.realpath.to_s
|
||||||
version = rp.match %r{^#{HOMEBREW_CELLAR}/python@(.*?)/}o
|
version = rp.match %r{^#{HOMEBREW_CELLAR}/python@(.*?)/}o
|
||||||
version = "@#{version.captures.first}" unless version.nil?
|
version = "@#{version.captures.first}" unless version.nil?
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user