unpack_strategy/zip: ensure consistent timezone management
This commit is contained in:
parent
94ce3236a5
commit
7ee76b85d5
@ -15,6 +15,7 @@ module UnpackStrategy
|
|||||||
|
|
||||||
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).returns(T.untyped) }
|
||||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||||
|
with_env(TZ: "UTC") do
|
||||||
if merge_xattrs && contains_extended_attributes?(path)
|
if merge_xattrs && contains_extended_attributes?(path)
|
||||||
# We use ditto directly, because dot_clean has issues if the __MACOSX
|
# We use ditto directly, because dot_clean has issues if the __MACOSX
|
||||||
# folder has incorrect permissions.
|
# folder has incorrect permissions.
|
||||||
@ -59,6 +60,7 @@ module UnpackStrategy
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,7 @@ module UnpackStrategy
|
|||||||
.returns(SystemCommand::Result)
|
.returns(SystemCommand::Result)
|
||||||
}
|
}
|
||||||
def extract_to_dir(unpack_dir, basename:, verbose:)
|
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||||
|
with_env(TZ: "UTC") do
|
||||||
quiet_flags = verbose ? [] : ["-qq"]
|
quiet_flags = verbose ? [] : ["-qq"]
|
||||||
result = system_command! "unzip",
|
result = system_command! "unzip",
|
||||||
args: [*quiet_flags, "-o", path, "-d", unpack_dir],
|
args: [*quiet_flags, "-o", path, "-d", unpack_dir],
|
||||||
@ -38,6 +39,7 @@ module UnpackStrategy
|
|||||||
result
|
result
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require "extend/os/mac/unpack_strategy/zip" if OS.mac?
|
require "extend/os/mac/unpack_strategy/zip" if OS.mac?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user