From daf56c11e302c253368906ba468e4c368d611d4e Mon Sep 17 00:00:00 2001 From: Sam James Date: Thu, 22 Dec 2022 03:39:39 +0000 Subject: compression: prefer gtar over tar if available Prefer 'gtar' over 'tar' if available, as we need GNU tar for --use-compress-program. With libarchive's tar, we get an 'unrecognized archive' error. Signed-off-by: Sam James Closes: https://github.com/pkgcore/snakeoil/pull/93 Signed-off-by: Arthur Zamarin --- src/snakeoil/compression/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/snakeoil/compression/__init__.py b/src/snakeoil/compression/__init__.py index 580a70a2..77c0631b 100644 --- a/src/snakeoil/compression/__init__.py +++ b/src/snakeoil/compression/__init__.py @@ -145,7 +145,7 @@ class _CompressedStdin: class _Tar(_Archive, ArComp): exts = frozenset(['.tar']) - binary = ('tar',) + binary = ('gtar', 'tar',) compress_binary = None default_unpack_cmd = '{binary} xf "{path}"' @@ -156,6 +156,7 @@ class _Tar(_Archive, ArComp): for b in self.compress_binary: try: process.find_binary(b[0]) + # FIXME: This is a gnuism, needs gnu tar. cmd += f' --use-compress-program="{" ".join(b)}"' break except process.CommandNotFound: -- cgit v1.2.3-65-gdbad