Remove now unnecessary realpath calls
This commit is contained in:
parent
d0831c4ef7
commit
cfee535786
@ -58,18 +58,14 @@ module Homebrew extend self
|
|||||||
end
|
end
|
||||||
|
|
||||||
def github_info f
|
def github_info f
|
||||||
path = f.path.realpath
|
if f.path.to_s =~ HOMEBREW_TAP_PATH_REGEX
|
||||||
|
|
||||||
if path.to_s =~ HOMEBREW_TAP_PATH_REGEX
|
|
||||||
user = $1
|
user = $1
|
||||||
repo = "homebrew-#$2"
|
repo = "homebrew-#$2"
|
||||||
path = $3
|
path = $3
|
||||||
else
|
else
|
||||||
path.parent.cd do
|
user = f.path.parent.cd { github_fork }
|
||||||
user = github_fork
|
|
||||||
end
|
|
||||||
repo = "homebrew"
|
repo = "homebrew"
|
||||||
path = "Library/Formula/#{path.basename}"
|
path = "Library/Formula/#{f.path.basename}"
|
||||||
end
|
end
|
||||||
|
|
||||||
"https://github.com/#{user}/#{repo}/commits/master/#{path}"
|
"https://github.com/#{user}/#{repo}/commits/master/#{path}"
|
||||||
|
|||||||
@ -5,7 +5,7 @@ module Homebrew extend self
|
|||||||
exec "git", "log", *ARGV.options_only
|
exec "git", "log", *ARGV.options_only
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
path = ARGV.formulae.first.path.realpath
|
path = ARGV.formulae.first.path
|
||||||
rescue FormulaUnavailableError
|
rescue FormulaUnavailableError
|
||||||
# Maybe the formula was deleted
|
# Maybe the formula was deleted
|
||||||
path = Formula.path(ARGV.named.first)
|
path = Formula.path(ARGV.named.first)
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class Formula
|
|||||||
private
|
private
|
||||||
def repository
|
def repository
|
||||||
@repository ||= begin
|
@repository ||= begin
|
||||||
if path.realpath.to_s =~ HOMEBREW_TAP_DIR_REGEX
|
if path.to_s =~ HOMEBREW_TAP_DIR_REGEX
|
||||||
HOMEBREW_REPOSITORY/"Library/Taps/#$1-#$2"
|
HOMEBREW_REPOSITORY/"Library/Taps/#$1-#$2"
|
||||||
else
|
else
|
||||||
HOMEBREW_REPOSITORY
|
HOMEBREW_REPOSITORY
|
||||||
|
|||||||
@ -196,7 +196,7 @@ class BuildError < Homebrew::InstallationError
|
|||||||
unless formula.core_formula?
|
unless formula.core_formula?
|
||||||
ohai "Formula"
|
ohai "Formula"
|
||||||
puts "Tap: #{formula.tap}"
|
puts "Tap: #{formula.tap}"
|
||||||
puts "Path: #{formula.path.realpath}"
|
puts "Path: #{formula.path}"
|
||||||
end
|
end
|
||||||
ohai "Configuration"
|
ohai "Configuration"
|
||||||
Homebrew.dump_build_config
|
Homebrew.dump_build_config
|
||||||
|
|||||||
@ -404,11 +404,11 @@ class Formula
|
|||||||
end
|
end
|
||||||
|
|
||||||
def tap?
|
def tap?
|
||||||
!!path.realpath.to_s.match(HOMEBREW_TAP_DIR_REGEX)
|
HOMEBREW_TAP_DIR_REGEX === path
|
||||||
end
|
end
|
||||||
|
|
||||||
def tap
|
def tap
|
||||||
if path.realpath.to_s =~ HOMEBREW_TAP_DIR_REGEX
|
if path.to_s =~ HOMEBREW_TAP_DIR_REGEX
|
||||||
"#$1/#$2"
|
"#$1/#$2"
|
||||||
elsif core_formula?
|
elsif core_formula?
|
||||||
"Homebrew/homebrew"
|
"Homebrew/homebrew"
|
||||||
@ -419,7 +419,7 @@ class Formula
|
|||||||
|
|
||||||
# True if this formula is provided by Homebrew itself
|
# True if this formula is provided by Homebrew itself
|
||||||
def core_formula?
|
def core_formula?
|
||||||
path.realpath == Formula.path(name)
|
path == Formula.path(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.path name
|
def self.path name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user