1 |
commit: 725aa5a066e69f5611e40c3cc84660eee07f940c |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 28 20:44:47 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 28 20:55:24 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=725aa5a0 |
7 |
|
8 |
unpacker.eclass: Workaround zstd refusing to process symlinks |
9 |
|
10 |
Closes: https://bugs.gentoo.org/873352 |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
eclass/tests/unpacker.sh | 7 ++++++- |
14 |
eclass/unpacker.eclass | 4 ++-- |
15 |
2 files changed, 8 insertions(+), 3 deletions(-) |
16 |
|
17 |
diff --git a/eclass/tests/unpacker.sh b/eclass/tests/unpacker.sh |
18 |
index b15953966f65..105f28fd4858 100755 |
19 |
--- a/eclass/tests/unpacker.sh |
20 |
+++ b/eclass/tests/unpacker.sh |
21 |
@@ -42,9 +42,14 @@ test_unpack() { |
22 |
eval "${packcmd}" |
23 |
assert "packing ${archive} failed" |
24 |
cd testdir || die |
25 |
+ |
26 |
+ # create a symlink to flush out compressor issues and resemble distdir more |
27 |
+ # https://bugs.gentoo.org/873352 |
28 |
+ ln -s "../${archive}" "${archive}" || die |
29 |
+ |
30 |
local out |
31 |
out=$( |
32 |
- _unpacker "../${archive}" 2>&1 |
33 |
+ _unpacker "${archive}" 2>&1 |
34 |
) |
35 |
ret=$? |
36 |
if [[ ${ret} -eq 0 ]]; then |
37 |
|
38 |
diff --git a/eclass/unpacker.eclass b/eclass/unpacker.eclass |
39 |
index 3d23151b636e..6c9bcbdd7a7b 100644 |
40 |
--- a/eclass/unpacker.eclass |
41 |
+++ b/eclass/unpacker.eclass |
42 |
@@ -523,11 +523,11 @@ _unpacker() { |
43 |
if [[ -z ${arch} ]] ; then |
44 |
# Need to decompress the file into $PWD #408801 |
45 |
local _a=${a%.*} |
46 |
- ${comp} "${a}" > "${_a##*/}" |
47 |
+ ${comp} < "${a}" > "${_a##*/}" |
48 |
elif [[ -z ${comp} ]] ; then |
49 |
${arch} "${a}" |
50 |
else |
51 |
- ${comp} "${a}" | ${arch} - |
52 |
+ ${comp} < "${a}" | ${arch} - |
53 |
fi |
54 |
|
55 |
assert "unpacking ${a} failed (comp=${comp} arch=${arch})" |