Merge pull request #7294 from Bo98/tab-built_on

tab: add built_on & arch information
This commit is contained in:
Mike McQuaid 2020-08-18 19:33:06 +01:00 committed by GitHub
commit 6106580cd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 1 deletions

View File

@ -99,6 +99,15 @@ class DevelopmentTools
def subversion_handles_most_https_certificates?
true
end
def build_system_info
{
"os" => ENV["HOMEBREW_SYSTEM"],
"os_version" => OS_VERSION,
"cpu_family" => Hardware::CPU.family,
}
end
alias generic_build_system_info build_system_info
end
end

View File

@ -56,5 +56,13 @@ class DevelopmentTools
brew install gcc
EOS
end
def build_system_info
build_info = {
"xcode" => MacOS::Xcode.version.to_s.presence,
"clt" => MacOS::CLT.version.to_s.presence,
}
generic_build_system_info.merge build_info
end
end
end

View File

@ -36,6 +36,7 @@ class Tab < OpenStruct
"stdlib" => stdlib,
"aliases" => formula.aliases,
"runtime_dependencies" => Tab.runtime_deps_hash(runtime_deps),
"arch" => Hardware::CPU.arch,
"source" => {
"path" => formula.specified_path.to_s,
"tap" => formula.tap&.name,
@ -47,6 +48,7 @@ class Tab < OpenStruct
"version_scheme" => formula.version_scheme,
},
},
"built_on" => DevelopmentTools.build_system_info,
}
new(attributes)
@ -198,6 +200,7 @@ class Tab < OpenStruct
"version_scheme" => 0,
},
},
"built_on" => DevelopmentTools.generic_build_system_info,
}
new(attributes)
@ -344,6 +347,7 @@ class Tab < OpenStruct
"aliases" => aliases,
"runtime_dependencies" => runtime_dependencies,
"source" => source,
"built_on" => built_on,
}
JSON.generate(attributes, options)

View File

@ -120,7 +120,7 @@ describe Caveats do
"plist_test.plist"
end
end
allow(ENV).to receive(:[]).with("TMUX").and_return(true)
ENV["TMUX"] = "1"
allow(Homebrew).to receive(:_system).with("/usr/bin/pbpaste").and_return(false)
caveats = described_class.new(f).caveats