Merge pull request #12302 from carlocab/TZ

build: set TZ=UTC0
This commit is contained in:
Carlo Cabrera 2021-10-22 20:26:13 +08:00 committed by GitHub
commit 5ffe1a3abc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,50 +131,54 @@ class Build
keep_tmp: args.keep_tmp?, keep_tmp: args.keep_tmp?,
interactive: args.interactive?, interactive: args.interactive?,
) do ) do
# For head builds, HOMEBREW_FORMULA_PREFIX should include the commit, with_env(
# which is not known until after the formula has been staged. # For head builds, HOMEBREW_FORMULA_PREFIX should include the commit,
ENV["HOMEBREW_FORMULA_PREFIX"] = formula.prefix # which is not known until after the formula has been staged.
HOMEBREW_FORMULA_PREFIX: formula.prefix,
# https://reproducible-builds.org/docs/source-date-epoch/ # https://reproducible-builds.org/docs/source-date-epoch/
ENV["SOURCE_DATE_EPOCH"] = formula.source_modified_time.to_i.to_s SOURCE_DATE_EPOCH: formula.source_modified_time.to_i.to_s,
# Avoid make getting confused about timestamps.
formula.patch # https://github.com/Homebrew/homebrew-core/pull/87470
TZ: "UTC0",
if args.git? ) do
system "git", "init" formula.patch
system "git", "add", "-A"
end
if args.interactive?
ohai "Entering interactive mode..."
puts <<~EOS
Type `exit` to return and finalize the installation.
Install to this prefix: #{formula.prefix}
EOS
if args.git? if args.git?
puts <<~EOS system "git", "init"
This directory is now a Git repository. Make your changes and then use: system "git", "add", "-A"
git diff | pbcopy
to copy the diff to the clipboard.
EOS
end end
if args.interactive?
ohai "Entering interactive mode..."
puts <<~EOS
Type `exit` to return and finalize the installation.
Install to this prefix: #{formula.prefix}
EOS
interactive_shell(formula) if args.git?
else puts <<~EOS
formula.prefix.mkpath This directory is now a Git repository. Make your changes and then use:
formula.logs.mkpath git diff | pbcopy
to copy the diff to the clipboard.
EOS
end
(formula.logs/"00.options.out").write \ interactive_shell(formula)
"#{formula.full_name} #{formula.build.used_options.sort.join(" ")}".strip else
formula.install formula.prefix.mkpath
formula.logs.mkpath
stdlibs = detect_stdlibs (formula.logs/"00.options.out").write \
tab = Tab.create(formula, ENV.compiler, stdlibs.first) "#{formula.full_name} #{formula.build.used_options.sort.join(" ")}".strip
tab.write formula.install
# Find and link metafiles stdlibs = detect_stdlibs
formula.prefix.install_metafiles formula.buildpath tab = Tab.create(formula, ENV.compiler, stdlibs.first)
formula.prefix.install_metafiles formula.libexec if formula.libexec.exist? tab.write
# Find and link metafiles
formula.prefix.install_metafiles formula.buildpath
formula.prefix.install_metafiles formula.libexec if formula.libexec.exist?
end
end end
end end
end end