mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Enable types in remaining untyped extensions
This commit is contained in:
parent
6397229f68
commit
0079cefc95
@ -1,18 +1,16 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
module_function
|
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
alias generic_git_tags git_tags
|
alias generic_git_tags git_tags
|
||||||
end
|
|
||||||
|
|
||||||
def git_tags
|
def git_tags
|
||||||
tags = generic_git_tags
|
tags = generic_git_tags
|
||||||
tags = Utils.popen_read("git tag --list | sort -rV") if tags.blank?
|
tags = Utils.popen_read("git tag --list | sort -rV") if tags.blank?
|
||||||
tags
|
tags
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "tempfile"
|
require "tempfile"
|
||||||
@ -46,7 +46,7 @@ module Homebrew
|
|||||||
f.write "#!/bin/sh\n"
|
f.write "#!/bin/sh\n"
|
||||||
f.chmod 0700
|
f.chmod 0700
|
||||||
f.close
|
f.close
|
||||||
return if system f.path
|
return if system T.must(f.path)
|
||||||
|
|
||||||
<<~EOS
|
<<~EOS
|
||||||
The directory #{HOMEBREW_TEMP} does not permit executing
|
The directory #{HOMEBREW_TEMP} does not permit executing
|
||||||
@ -56,12 +56,12 @@ module Homebrew
|
|||||||
echo 'export HOMEBREW_TEMP=~/tmp' >> #{shell_profile}
|
echo 'export HOMEBREW_TEMP=~/tmp' >> #{shell_profile}
|
||||||
EOS
|
EOS
|
||||||
ensure
|
ensure
|
||||||
f.unlink
|
f&.unlink
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_xdg_data_dirs
|
def check_xdg_data_dirs
|
||||||
return if ENV["XDG_DATA_DIRS"].blank?
|
xdg_data_dirs = ENV["XDG_DATA_DIRS"]
|
||||||
return if ENV["XDG_DATA_DIRS"].split("/").include?(HOMEBREW_PREFIX/"share")
|
return if xdg_data_dirs.blank? || xdg_data_dirs.split("/").include?(HOMEBREW_PREFIX/"share")
|
||||||
|
|
||||||
<<~EOS
|
<<~EOS
|
||||||
Homebrew's share was not found in your XDG_DATA_DIRS but you have
|
Homebrew's share was not found in your XDG_DATA_DIRS but you have
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Hardware
|
module Hardware
|
||||||
@ -111,6 +111,7 @@ module Hardware
|
|||||||
end
|
end
|
||||||
|
|
||||||
%w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag|
|
%w[aes altivec avx avx2 lm ssse3 sse4_2].each do |flag|
|
||||||
|
T.bind(self, T.class_of(Hardware::CPU))
|
||||||
define_method("#{flag}?") { flags.include? flag }
|
define_method("#{flag}?") { flags.include? flag }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
@ -379,7 +379,7 @@ module Homebrew
|
|||||||
real_tmp = tmp.realpath.parent
|
real_tmp = tmp.realpath.parent
|
||||||
where_tmp = volumes.which real_tmp
|
where_tmp = volumes.which real_tmp
|
||||||
ensure
|
ensure
|
||||||
Dir.delete tmp
|
Dir.delete tmp.to_s
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user