Commit 737a0c6b authored by Julien Muchembled's avatar Julien Muchembled

downloadunpacked: fix extraction of symlinks when using an external decompressor

parent f7bfa146
Pipeline #21963 passed with stage
in 0 seconds
...@@ -29,6 +29,7 @@ import os ...@@ -29,6 +29,7 @@ import os
import subprocess import subprocess
import tarfile import tarfile
import tempfile import tempfile
from functools import partial
from setuptools import archive_util from setuptools import archive_util
from . import is_true, EnvironMixin, Shared from . import is_true, EnvironMixin, Shared
...@@ -118,8 +119,8 @@ def unpack_archive(recipe, *args): ...@@ -118,8 +119,8 @@ def unpack_archive(recipe, *args):
with tempfile.NamedTemporaryFile() as uncompressed_archive: with tempfile.NamedTemporaryFile() as uncompressed_archive:
subprocess.check_call(cmd + (filename,), subprocess.check_call(cmd + (filename,),
stdout=uncompressed_archive, env=recipe.environ) stdout=uncompressed_archive, env=recipe.environ)
archive_util.unpack_archive( unpack_archive(uncompressed_archive.name,
uncompressed_archive.name, extract_dir, progress_filter) extract_dir, progress_filter)
return True return True
raise archive_util.UnrecognizedFormat( raise archive_util.UnrecognizedFormat(
"%s is not a compressed or uncompressed tar file" % (filename,) "%s is not a compressed or uncompressed tar file" % (filename,)
...@@ -149,5 +150,6 @@ def unpack_archive(recipe, *args): ...@@ -149,5 +150,6 @@ def unpack_archive(recipe, *args):
pass pass
return True return True
return archive_util.unpack_archive(*args, unpack_archive = partial(archive_util.unpack_archive,
drivers = archive_util.extraction_drivers[:2] + (unpack_tarfile_patched,)) drivers = archive_util.extraction_drivers[:2] + (unpack_tarfile_patched,))
return unpack_archive(*args)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment