From f5e33950c1d0d0f793bee0a7401d99825bbe0804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 24 Jun 2020 14:47:28 +0200 Subject: [PATCH] Unpack RPMs using rpm2archive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should support both older files compressed with cpio as well as newer zstd-compressed files. Signed-off-by: Lubomír Sedlář --- pungi/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pungi/util.py b/pungi/util.py index 0e89ad6a..f10fbc61 100644 --- a/pungi/util.py +++ b/pungi/util.py @@ -189,8 +189,9 @@ def explode_rpm_package(pkg_path, target_dir): """Explode a rpm package into target_dir.""" pkg_path = os.path.abspath(pkg_path) makedirs(target_dir) + # rpm2archive writes to stdout only if reading from stdin, thus the redirect run( - "rpm2cpio %s | cpio -iuvmd && chmod -R a+rX ." % shlex_quote(pkg_path), + "rpm2archive - <%s | tar xfz - && chmod -R a+rX ." % shlex_quote(pkg_path), workdir=target_dir, )