mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Use locals instead of repeatedly converting pathnames to strings
This commit is contained in:
parent
ecc9407fed
commit
ddefbe2c85
@ -152,7 +152,7 @@ module Homebrew
|
|||||||
cellar, Keg::CELLAR_PLACEHOLDER, :keg_only => f.keg_only?
|
cellar, Keg::CELLAR_PLACEHOLDER, :keg_only => f.keg_only?
|
||||||
keg.delete_pyc_files!
|
keg.delete_pyc_files!
|
||||||
|
|
||||||
HOMEBREW_CELLAR.cd do
|
cd cellar do
|
||||||
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
|
# Use gzip, faster to compress than bzip2, faster to uncompress than bzip2
|
||||||
# or an uncompressed tarball (and more bandwidth friendly).
|
# or an uncompressed tarball (and more bandwidth friendly).
|
||||||
safe_system 'tar', 'czf', bottle_path, "#{f.name}/#{f.pkg_version}"
|
safe_system 'tar', 'czf', bottle_path, "#{f.name}/#{f.pkg_version}"
|
||||||
@ -163,13 +163,13 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
if prefix == '/usr/local'
|
if prefix == '/usr/local'
|
||||||
prefix_check = HOMEBREW_PREFIX/'opt'
|
prefix_check = File.join(prefix, "opt")
|
||||||
else
|
else
|
||||||
prefix_check = HOMEBREW_PREFIX
|
prefix_check = prefix
|
||||||
end
|
end
|
||||||
|
|
||||||
relocatable = !keg_contains(prefix_check.to_s, keg)
|
relocatable = !keg_contains(prefix_check, keg)
|
||||||
relocatable = !keg_contains(HOMEBREW_CELLAR.to_s, keg) && relocatable
|
relocatable = !keg_contains(cellar, keg) && relocatable
|
||||||
puts if !relocatable && ARGV.verbose?
|
puts if !relocatable && ARGV.verbose?
|
||||||
rescue Interrupt
|
rescue Interrupt
|
||||||
ignore_interrupts { bottle_path.unlink if bottle_path.exist? }
|
ignore_interrupts { bottle_path.unlink if bottle_path.exist? }
|
||||||
@ -186,8 +186,8 @@ module Homebrew
|
|||||||
|
|
||||||
bottle = BottleSpecification.new
|
bottle = BottleSpecification.new
|
||||||
bottle.root_url(root_url) if root_url
|
bottle.root_url(root_url) if root_url
|
||||||
bottle.prefix HOMEBREW_PREFIX.to_s
|
bottle.prefix prefix
|
||||||
bottle.cellar relocatable ? :any : HOMEBREW_CELLAR.to_s
|
bottle.cellar relocatable ? :any : cellar
|
||||||
bottle.revision bottle_revision
|
bottle.revision bottle_revision
|
||||||
bottle.sha1 bottle_path.sha1 => bottle_tag
|
bottle.sha1 bottle_path.sha1 => bottle_tag
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user