diff options
| author | Samuel John | 2013-06-17 09:01:37 +0200 |
|---|---|---|
| committer | Samuel John | 2013-06-18 20:49:13 +0200 |
| commit | fbaf8a5968c69c7914027162368af5a738ad639e (patch) | |
| tree | 6200899f59411ff0b0fa02303f2a9d829ba80a80 /Library | |
| parent | a3a0146d7ccd89755439f1b8be7e1dd28b75a88b (diff) | |
| download | brew-fbaf8a5968c69c7914027162368af5a738ad639e.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 |
