From 34bd99af8d16a3ce1238f32de3a1bb5fb9da4f7f Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Thu, 8 Mar 2018 08:10:48 -0800 Subject: [PATCH] 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. --- Library/Homebrew/language/python.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index c41e22b5ce..903e1317d5 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -184,7 +184,7 @@ module Language @venv_root.find do |f| next unless f.symlink? 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 f.unlink f.make_symlink new_target @@ -192,7 +192,7 @@ module Language Pathname.glob(@venv_root/"lib/python*/orig-prefix.txt").each do |prefix_file| 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_file.atomic_write prefix_path end