Skip to content
Snippets Groups Projects
Commit 8113a9fe authored by Markus Reiter's avatar Markus Reiter
Browse files

Remove XIP support.

parent 33fa8094
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@ require "hbc/container/tar"
require "hbc/container/ttf"
require "hbc/container/rar"
require "hbc/container/xar"
require "hbc/container/xip"
require "hbc/container/xz"
require "hbc/container/zip"
......@@ -34,7 +33,6 @@ module Hbc
Sit,
Rar,
Zip,
Xip, # needs to be before xar as this is a cpio inside a gzip inside a xar
Xar, # need to be before tar as tar can also list xar
Tar, # or compressed tar (bzip2/gzip/lzma/xz)
Bzip2, # pure bzip2
......
require "tmpdir"
module Hbc
class Container
class Xip < Base
def self.me?(criteria)
criteria.magic_number(/^xar!/n) &&
IO.popen(["/usr/bin/xar", "-t", "-f", criteria.path.to_s], err: "/dev/null") { |io| io.read =~ /\AContent\nMetadata\n\Z/ }
end
def extract
Dir.mktmpdir do |unpack_dir|
begin
ohai "Verifying signature for #{@path.basename}"
@command.run!("/usr/sbin/pkgutil", args: ["--check-signature", @path])
rescue
raise "Signature check failed."
end
@command.run!("/usr/bin/xar", args: ["-x", "-f", @path, "Content", "-C", unpack_dir])
Dir.chdir(@cask.staged_path) do
@command.run!("/usr/bin/cpio", args: ["--quiet", "-i", "-I", Pathname(unpack_dir).join("Content")])
end
end
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment