34 lines
1017 B
Ruby
Raw Normal View History

2023-02-02 21:57:47 +09:00
# typed: false
# frozen_string_literal: true
module Homebrew
extend T::Sig
module_function
def setup_tar_and_args!(args, mtime)
2023-02-06 21:15:38 +09:00
generic_setup_tar_and_args!(args, mtime)
2023-02-02 21:57:47 +09:00
2023-02-07 19:17:00 +09:00
["tar", gnutar_args(mtime)].freeze
2023-02-02 21:57:47 +09:00
end
def formula_ignores(f)
cellar_regex = Regexp.escape(HOMEBREW_CELLAR)
prefix_regex = Regexp.escape(HOMEBREW_PREFIX)
ignores = generic_formula_ignores(f)
2023-02-02 21:57:47 +09:00
ignores << case f.name
# On Linux, GCC installation can be moved so long as the whole directory tree is moved together:
# https://gcc-help.gcc.gnu.narkive.com/GnwuCA7l/moving-gcc-from-the-installation-path-is-it-allowed.
when Version.formula_optionally_versioned_regex(:gcc)
Regexp.union(%r{#{cellar_regex}/gcc}, %r{#{prefix_regex}/opt/gcc})
# binutils is relocatable for the same reason: https://github.com/Homebrew/brew/pull/11899#issuecomment-906804451.
when Version.formula_optionally_versioned_regex(:binutils)
%r{#{cellar_regex}/binutils}
end
ignores.compact
end
end