From b0bab803d2f1c96af5760374e2684f9a85591916 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 2 Oct 2022 01:11:51 +0100 Subject: gentoo auto-resync : 02:10:2022 - 01:11:51 --- eclass/unpacker.eclass | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'eclass/unpacker.eclass') diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass index 6c9bcbdd7a7b..3d8bf7a8452d 100644 --- a/eclass/unpacker.eclass +++ b/eclass/unpacker.eclass @@ -218,6 +218,14 @@ unpack_makeself() { skip=$(head -n ${skip} "${src}" | wc -c) exe="dd" ;; + 2.4.5) + # e.g.: skip="713" + skip=$( + sed -n -e '/^skip=/{s:skip="\(.*\)":\1:p;q}' "${src}" + ) + skip=$(head -n "${skip}" "${src}" | wc -c) + exe="dd" + ;; *) eerror "I'm sorry, but I was unable to support the Makeself file." eerror "The version I detected was '${ver}'." @@ -235,30 +243,43 @@ unpack_makeself() { esac # lets grab the first few bytes of the file to figure out what kind of archive it is - local filetype tmpfile="${T}/${FUNCNAME}" - "${exe[@]}" 2>/dev/null | head -c 512 > "${tmpfile}" - filetype=$(file -b "${tmpfile}") || die + local decomp= filetype suffix + filetype=$("${exe[@]}" 2>/dev/null | head -c 512 | file -b -) || die case ${filetype} in *tar\ archive*) - "${exe[@]}" | tar --no-same-owner -xf - + decomp=cat ;; bzip2*) - "${exe[@]}" | bzip2 -dc | tar --no-same-owner -xf - + suffix=bz2 ;; gzip*) - "${exe[@]}" | tar --no-same-owner -xzf - + suffix=gz ;; compress*) - "${exe[@]}" | gunzip | tar --no-same-owner -xf - + suffix=z ;; XZ*) - "${exe[@]}" | unxz | tar --no-same-owner -xf - + suffix=xz + ;; + Zstandard*) + suffix=zst + ;; + lzop*) + suffix=lzo + ;; + LZ4*) + suffix=lz4 + ;; + "ASCII text"*) + decomp='base64 -d' ;; *) - eerror "Unknown filetype \"${filetype}\" ?" - false + die "Unknown filetype \"${filetype}\", for makeself ${src##*/} ('${ver}' +${skip})" ;; esac + + [[ -z ${decomp} ]] && decomp=$(_unpacker_get_decompressor ".${suffix}") + "${exe[@]}" | ${decomp} | tar --no-same-owner -xf - assert "failure unpacking (${filetype}) makeself ${src##*/} ('${ver}' +${skip})" } -- cgit v1.2.3