Skip to content

Commit

Permalink
Merge pull request #16288 from Bo98/macos-zip-fix
Browse files Browse the repository at this point in the history
unpack_strategy/zip: fix super ancestor on macOS without Sorbet Runtime
  • Loading branch information
Bo98 committed Dec 4, 2023
2 parents 8fbe927 + cc0a249 commit 4889e10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
module UnpackStrategy
class Zip
module MacOSZipExtension
include UnpackStrategy
include SystemCommand::Mixin
private

sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
sig { params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) }
def extract_to_dir(unpack_dir, basename:, verbose:)
with_env(TZ: "UTC") do
if merge_xattrs && contains_extended_attributes?(path)
Expand Down Expand Up @@ -58,8 +57,6 @@ def extract_to_dir(unpack_dir, basename:, verbose:)
end
end

private

sig { params(path: Pathname).returns(T::Boolean) }
def contains_extended_attributes?(path)
path.zipinfo.grep(/(^__MACOSX|\._)/).any?
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/extend/os/mac/unpack_strategy/zip.rbi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# typed: strict

module UnpackStrategy::Zip::MacOSZipExtension
include Kernel
requires_ancestor { UnpackStrategy }
end

0 comments on commit 4889e10

Please sign in to comment.