Fix .deb unarchive algorithm (#5931)

* Add files via upload

* Add exception switch back

* Bump version
This commit is contained in:
supechicken
2021-07-07 21:31:50 +08:00
committed by GitHub
parent 4706deee86
commit d20067a1c6
2 changed files with 13 additions and 2 deletions

View File

@@ -769,7 +769,18 @@ def unpack(meta)
system "tar x#{@verbose}f #{meta[:filename]} -C #{@extract_dir}", exception: true
when /\.deb$/i
puts "Unpacking archive using 'ar', this may take a while..."
system "ar -p #{meta[:filename]} data.tar.xz | xz -dc#{@verbose} | tar x#{@verbose} -C #{@extract_dir}", exception: true
suffix = `ar -t #{meta[:filename]}`.scan(/data.(.*)/)[0][0]
case suffix
when 'tar.xz'
tar_opt = '--xz'
when 'tgz', 'tar.gz'
tar_opt = '--gzip'
when 'bzip2'
tar_opt = '--bzip2'
end
system "ar -p #{meta[:filename]} data.#{suffix} | tar x#{@verbose} #{tar_opt} -C #{@extract_dir}", exception: true
when /\.AppImage$/i
puts "Unpacking 'AppImage' archive, this may take a while..."
FileUtils.chmod 0o755, meta[:filename], verbose: @fileutils_verbose

View File

@@ -1,6 +1,6 @@
# Defines common constants used in different parts of crew
CREW_VERSION = '1.11.5'
CREW_VERSION = '1.11.6'
ARCH_ACTUAL = `uname -m`.strip
# This helps with virtualized builds on aarch64 machines