Skip to content

Commit

Permalink
unpacker.eclass: Workaround zstd refusing to process symlinks
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/873352
Signed-off-by: Michał Górny <[email protected]>
  • Loading branch information
mgorny committed Sep 28, 2022
1 parent 46a6338 commit 725aa5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion eclass/tests/unpacker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ test_unpack() {
eval "${packcmd}"
assert "packing ${archive} failed"
cd testdir || die

# create a symlink to flush out compressor issues and resemble distdir more
# https://bugs.gentoo.org/873352
ln -s "../${archive}" "${archive}" || die

local out
out=$(
_unpacker "../${archive}" 2>&1
_unpacker "${archive}" 2>&1
)
ret=$?
if [[ ${ret} -eq 0 ]]; then
Expand Down
4 changes: 2 additions & 2 deletions eclass/unpacker.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,11 @@ _unpacker() {
if [[ -z ${arch} ]] ; then
# Need to decompress the file into $PWD #408801
local _a=${a%.*}
${comp} "${a}" > "${_a##*/}"
${comp} < "${a}" > "${_a##*/}"
elif [[ -z ${comp} ]] ; then
${arch} "${a}"
else
${comp} "${a}" | ${arch} -
${comp} < "${a}" | ${arch} -
fi

assert "unpacking ${a} failed (comp=${comp} arch=${arch})"
Expand Down

0 comments on commit 725aa5a

Please sign in to comment.