Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Wed, 08 Mar 2017 07:36:17
Message-Id: 1488958537.2815d61ee148bc442b450c017a9c9e7ad0a34c19.mgorny@gentoo
1 commit: 2815d61ee148bc442b450c017a9c9e7ad0a34c19
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 23 19:44:28 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 8 07:35:37 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2815d61e
7
8 unpacker.eclass: Replace unnecessary eval with array
9
10 Replace the eval used to attempt to construct whitespace-path-safe
11 utility calls with much simpler bash arrays.
12
13 eclass/unpacker.eclass | 18 +++++++++---------
14 1 file changed, 9 insertions(+), 9 deletions(-)
15
16 diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass
17 index 8c55cc5319b..6e996120646 100644
18 --- a/eclass/unpacker.eclass
19 +++ b/eclass/unpacker.eclass
20 @@ -1,4 +1,4 @@
21 -# Copyright 1999-2014 Gentoo Foundation
22 +# Copyright 1999-2017 Gentoo Foundation
23 # Distributed under the terms of the GNU General Public License v2
24
25 # @ECLASS: unpacker.eclass
26 @@ -218,30 +218,30 @@ unpack_makeself() {
27 debug-print "Detected Makeself version ${ver} ... using ${skip} as offset"
28 fi
29 case ${exe} in
30 - tail) exe="tail -n +${skip} '${src}'";;
31 - dd) exe="dd ibs=${skip} skip=1 if='${src}'";;
32 + tail) exe=( tail -n +${skip} "${src}" );;
33 + dd) exe=( dd ibs=${skip} skip=1 if="${src}" );;
34 *) die "makeself cant handle exe '${exe}'"
35 esac
36
37 # lets grab the first few bytes of the file to figure out what kind of archive it is
38 local filetype tmpfile="${T}/${FUNCNAME}"
39 - eval ${exe} 2>/dev/null | head -c 512 > "${tmpfile}"
40 + "${exe[@]}" 2>/dev/null | head -c 512 > "${tmpfile}"
41 filetype=$(file -b "${tmpfile}") || die
42 case ${filetype} in
43 *tar\ archive*)
44 - eval ${exe} | tar --no-same-owner -xf -
45 + "${exe[@]}" | tar --no-same-owner -xf -
46 ;;
47 bzip2*)
48 - eval ${exe} | bzip2 -dc | tar --no-same-owner -xf -
49 + "${exe[@]}" | bzip2 -dc | tar --no-same-owner -xf -
50 ;;
51 gzip*)
52 - eval ${exe} | tar --no-same-owner -xzf -
53 + "${exe[@]}" | tar --no-same-owner -xzf -
54 ;;
55 compress*)
56 - eval ${exe} | gunzip | tar --no-same-owner -xf -
57 + "${exe[@]}" | gunzip | tar --no-same-owner -xf -
58 ;;
59 XZ*)
60 - eval ${exe} | unxz | tar --no-same-owner -xf -
61 + "${exe[@]}" | unxz | tar --no-same-owner -xf -
62 ;;
63 *)
64 eerror "Unknown filetype \"${filetype}\" ?"