diff options
| author | Jack Nagel | 2013-12-04 22:37:57 -0600 |
|---|---|---|
| committer | Jack Nagel | 2013-12-04 22:37:57 -0600 |
| commit | 1a3eb21379f3a64cfeec5d67a54efdd3f4e24620 (patch) | |
| tree | 4791b144c371c42636e14ee7a9e7e719c9caa329 /Library/Homebrew/cmd | |
| parent | 3e733aef7c4454e7ae376ff61a9bc62eb4caa915 (diff) | |
| download | homebrew-1a3eb21379f3a64cfeec5d67a54efdd3f4e24620.tar.bz2 | |
Insert placeholders for prefix and cellar in relocatable bottles
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/bottle.rb | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/bottle.rb b/Library/Homebrew/cmd/bottle.rb index 40176d4c9..8331619f8 100644 --- a/Library/Homebrew/cmd/bottle.rb +++ b/Library/Homebrew/cmd/bottle.rb @@ -124,16 +124,30 @@ module Homebrew extend self HOMEBREW_CELLAR.cd do ohai "Bottling #{filename}..." - # Use gzip, faster to compress than bzip2, faster to uncompress than bzip2 - # or an uncompressed tarball (and more bandwidth friendly). - safe_system 'tar', 'czf', bottle_path, "#{f.name}/#{f.version}" + + keg = Keg.new(f.prefix) + + keg.lock do + begin + keg.relocate_install_names prefix, Keg::PREFIX_PLACEHOLDER, + cellar, Keg::CELLAR_PLACEHOLDER, :keg_only => f.keg_only? + + # Use gzip, faster to compress than bzip2, faster to uncompress than bzip2 + # or an uncompressed tarball (and more bandwidth friendly). + safe_system 'tar', 'czf', bottle_path, "#{f.name}/#{f.version}" + ensure + keg.relocate_install_names Keg::PREFIX_PLACEHOLDER, prefix, + Keg::CELLAR_PLACEHOLDER, cellar, :keg_only => f.keg_only? + end + end + sha1 = bottle_path.sha1 relocatable = false if File.size?(bottle_path) > 1*1024*1024 ohai "Detecting if #{filename} is relocatable..." end - keg = Keg.new f.prefix + keg.lock do # Relocate bottle library references before testing for built-in # references to the Cellar e.g. Qt's QMake annoyingly does this. |
