Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 5/5] unpacker.eclass: Check makeself compression without a tempfile
Date: Wed, 28 Sep 2022 21:00:54
Message-Id: 20220928205907.15979-6-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/5] unpacker.eclass: makeself improvements + tests by "Michał Górny"
1 Signed-off-by: Michał Górny <mgorny@g.o>
2 ---
3 eclass/unpacker.eclass | 5 ++---
4 1 file changed, 2 insertions(+), 3 deletions(-)
5
6 diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
7 index dfcb111e00f5..02000dd5d911 100644
8 --- a/eclass/unpacker.eclass
9 +++ b/eclass/unpacker.eclass
10 @@ -243,9 +243,8 @@ unpack_makeself() {
11 esac
12
13 # lets grab the first few bytes of the file to figure out what kind of archive it is
14 - local decomp= filetype suffix tmpfile="${T}/${FUNCNAME}"
15 - "${exe[@]}" 2>/dev/null | head -c 512 > "${tmpfile}"
16 - filetype=$(file -b "${tmpfile}") || die
17 + local decomp= filetype suffix
18 + filetype=$("${exe[@]}" 2>/dev/null | head -c 512 | file -b -) || die
19 case ${filetype} in
20 *tar\ archive*)
21 decomp=cat
22 --
23 2.37.3