diff options
| author | Samuel John | 2013-06-17 09:01:37 +0200 |
|---|---|---|
| committer | Samuel John | 2013-06-18 20:49:13 +0200 |
| commit | be34141f166bf7d093254602baad41b981f72833 (patch) | |
| tree | f985faf0059198ce9974f41a98d79c108ecfdf8f /Library | |
| parent | 1dd90572f7c3110db5930d0be3d741b70c73df89 (diff) | |
| download | homebrew-be34141f166bf7d093254602baad41b981f72833.tar.bz2 | |
Linking Frameworks correctly if multiple.
For example python and python3 both provide a
`Python.framework` and OS X Frameworks are made to
deal with this by putting them into `Versions` and
linking the default one as `Current`. However, brew
did not respect this and cleaned out stuff making
neither of the two versions work because `Current`
is replaced by an empty directory.
This commit fixes that. However, still one of the
two `Python.frameworks` has to remove it's
`Current` and `Headers` links, because brew cannot
decide alone which one is the "default" and allowed
to set the `Current` link.
A similar situation might apply to Qt 4 vs. 5..
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/keg.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 7b4ad84fd..04d1be8e1 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -115,7 +115,6 @@ class Keg < Pathname link_dir('bin', mode) {:skip_dir} link_dir('sbin', mode) {:skip_dir} link_dir('include', mode) {:link} - link_dir('Frameworks', mode) { :link } link_dir('share', mode) do |path| case path.to_s @@ -148,6 +147,18 @@ class Keg < Pathname end end + link_dir('Frameworks', mode) do |path| + # Frameworks contain symlinks pointing into a subdir, so we have to use + # the :link strategy. However, for Foo.framework and + # Foo.framework/Versions we have to use :mkpath so that multiple formulae + # can link their versions into it and `brew [un]link` works. + if path.to_s =~ /[^\/]*\.framework(\/Versions)?$/ + :mkpath + else + :link + end + end + unless mode.dry_run linked_keg_record.make_relative_symlink(self) optlink |
