Fix extracting .pax archives.
This commit is contained in:
parent
1fe8cf7079
commit
06549c751b
@ -30,6 +30,7 @@ module UnpackStrategy
|
|||||||
def self.strategies
|
def self.strategies
|
||||||
@strategies ||= [
|
@strategies ||= [
|
||||||
Tar, # needs to be before Bzip2/Gzip/Xz/Lzma
|
Tar, # needs to be before Bzip2/Gzip/Xz/Lzma
|
||||||
|
Pax,
|
||||||
Gzip,
|
Gzip,
|
||||||
Lzma,
|
Lzma,
|
||||||
Xz,
|
Xz,
|
||||||
@ -78,7 +79,7 @@ module UnpackStrategy
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.from_extension(extension)
|
def self.from_extension(extension)
|
||||||
strategies.sort_by { |s| s.extensions.map(&:length).max(0) }
|
strategies.sort_by { |s| s.extensions.map(&:length).max || 0 }
|
||||||
.reverse
|
.reverse
|
||||||
.find { |s| s.extensions.any? { |ext| extension.end_with?(ext) } }
|
.find { |s| s.extensions.any? { |ext| extension.end_with?(ext) } }
|
||||||
end
|
end
|
||||||
@ -165,6 +166,7 @@ require "unpack_strategy/mercurial"
|
|||||||
require "unpack_strategy/microsoft_office_xml"
|
require "unpack_strategy/microsoft_office_xml"
|
||||||
require "unpack_strategy/otf"
|
require "unpack_strategy/otf"
|
||||||
require "unpack_strategy/p7zip"
|
require "unpack_strategy/p7zip"
|
||||||
|
require "unpack_strategy/pax"
|
||||||
require "unpack_strategy/pkg"
|
require "unpack_strategy/pkg"
|
||||||
require "unpack_strategy/rar"
|
require "unpack_strategy/rar"
|
||||||
require "unpack_strategy/self_extracting_executable"
|
require "unpack_strategy/self_extracting_executable"
|
||||||
|
|||||||
24
Library/Homebrew/unpack_strategy/pax.rb
Normal file
24
Library/Homebrew/unpack_strategy/pax.rb
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
module UnpackStrategy
|
||||||
|
class Pax
|
||||||
|
include UnpackStrategy
|
||||||
|
|
||||||
|
using Magic
|
||||||
|
|
||||||
|
def self.extensions
|
||||||
|
[".pax"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.can_extract?(_path)
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def extract_to_dir(unpack_dir, basename:, verbose:)
|
||||||
|
system_command! "pax",
|
||||||
|
args: ["-rf", path],
|
||||||
|
chdir: unpack_dir,
|
||||||
|
verbose: verbose
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user