All the extract_to_dirs return void now
This commit is contained in:
parent
0076a88541
commit
9c6430954b
@ -8,7 +8,7 @@ module UnpackStrategy
|
||||
module MacOSZipExtension
|
||||
private
|
||||
|
||||
sig { params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
with_env(TZ: "UTC") do
|
||||
if merge_xattrs && contains_extended_attributes?(path)
|
||||
|
||||
@ -27,7 +27,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
system_command! AIR_APPLICATION_INSTALLER,
|
||||
args: ["-silent", "-location", unpack_dir, path],
|
||||
|
||||
@ -12,7 +12,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
super
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
FileUtils.cp path, unpack_dir/basename, preserve: true
|
||||
quiet_flags = verbose ? [] : ["-q"]
|
||||
|
||||
@ -15,7 +15,7 @@ module UnpackStrategy
|
||||
path.magic_number.match?(/\AMSCF/n)
|
||||
end
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
system_command! "cabextract",
|
||||
args: ["-d", unpack_dir, "--", path],
|
||||
|
||||
@ -17,7 +17,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
path.children.each do |child|
|
||||
system_command! "cp",
|
||||
|
||||
@ -129,7 +129,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
tries = 3
|
||||
bom = begin
|
||||
@ -183,7 +183,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
mount(verbose:) do |mounts|
|
||||
raise "No mounts found in '#{path}'; perhaps this is a bad disk image?" if mounts.empty?
|
||||
|
||||
@ -24,7 +24,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
args = if @ref_type && @ref
|
||||
[@ref]
|
||||
|
||||
@ -21,7 +21,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
system_command! "unar",
|
||||
args: [
|
||||
|
||||
@ -17,7 +17,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
FileUtils.cp path, unpack_dir/basename, preserve: true
|
||||
quiet_flags = verbose ? [] : ["-q"]
|
||||
|
||||
@ -21,7 +21,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
system_command! "lha",
|
||||
args: ["xq2w=#{unpack_dir}", path],
|
||||
|
||||
@ -21,7 +21,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
FileUtils.cp path, unpack_dir/basename, preserve: true
|
||||
quiet_flags = verbose ? [] : ["-q"]
|
||||
|
||||
@ -21,7 +21,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
FileUtils.cp path, unpack_dir/basename, preserve: true
|
||||
quiet_flags = verbose ? [] : ["-q"]
|
||||
|
||||
@ -21,7 +21,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
system_command! "7zr",
|
||||
args: ["x", "-y", "-bd", "-bso0", path, "-o#{unpack_dir}"],
|
||||
|
||||
@ -17,7 +17,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
system_command! "pax",
|
||||
args: ["-rf", path],
|
||||
|
||||
@ -21,7 +21,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
system_command! "bsdtar",
|
||||
args: ["x", "-f", path, "-C", unpack_dir],
|
||||
|
||||
@ -34,7 +34,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
Dir.mktmpdir("homebrew-tar", HOMEBREW_TEMP) do |tmpdir|
|
||||
tar_path = if DependencyCollector.tar_needs_xz_dependency? && Xz.can_extract?(path)
|
||||
|
||||
@ -26,7 +26,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose: false)
|
||||
FileUtils.cp path, unpack_dir/basename.sub(/^[\da-f]{64}--/, ""), preserve: true, verbose:
|
||||
end
|
||||
|
||||
@ -17,7 +17,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
system_command! "xar",
|
||||
args: ["-x", "-f", path, "-C", unpack_dir],
|
||||
|
||||
@ -21,7 +21,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
FileUtils.cp path, unpack_dir/basename, preserve: true
|
||||
quiet_flags = verbose ? [] : ["-q"]
|
||||
|
||||
@ -21,7 +21,7 @@ module UnpackStrategy
|
||||
|
||||
private
|
||||
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
|
||||
sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void }
|
||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||
FileUtils.cp path, unpack_dir/basename, preserve: true
|
||||
quiet_flags = verbose ? [] : ["-q"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user