language/python: expect @ in python@2 Cellar paths
The realpath of the python@2 Cellar contains "python@2" not "python2" so check for "python@2" when doing Cellar->opt robustifications.
This commit is contained in:
parent
74443999f4
commit
34bd99af8d
@ -184,7 +184,7 @@ module Language
|
|||||||
@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 (rp = f.realpath.to_s).start_with? HOMEBREW_CELLAR
|
||||||
python = rp.include?("python2") ? "python2" : "python"
|
python = rp.include?("python@2") ? "python@2" : "python"
|
||||||
new_target = rp.sub %r{#{HOMEBREW_CELLAR}/#{python}/[^/]+}, Formula[python].opt_prefix
|
new_target = rp.sub %r{#{HOMEBREW_CELLAR}/#{python}/[^/]+}, Formula[python].opt_prefix
|
||||||
f.unlink
|
f.unlink
|
||||||
f.make_symlink new_target
|
f.make_symlink new_target
|
||||||
@ -192,7 +192,7 @@ module Language
|
|||||||
|
|
||||||
Pathname.glob(@venv_root/"lib/python*/orig-prefix.txt").each do |prefix_file|
|
Pathname.glob(@venv_root/"lib/python*/orig-prefix.txt").each do |prefix_file|
|
||||||
prefix_path = prefix_file.read
|
prefix_path = prefix_file.read
|
||||||
python = prefix_path.include?("python2") ? "python2" : "python"
|
python = prefix_path.include?("python@2") ? "python@2" : "python"
|
||||||
prefix_path.sub! %r{^#{HOMEBREW_CELLAR}/#{python}/[^/]+}, Formula[python].opt_prefix
|
prefix_path.sub! %r{^#{HOMEBREW_CELLAR}/#{python}/[^/]+}, Formula[python].opt_prefix
|
||||||
prefix_file.atomic_write prefix_path
|
prefix_file.atomic_write prefix_path
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user