Fall back to rpm2cpio
JIRA: RHELCMP-2030 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
1e1c8533ac
commit
b557bf160f
@ -189,11 +189,19 @@ def explode_rpm_package(pkg_path, target_dir):
|
|||||||
"""Explode a rpm package into target_dir."""
|
"""Explode a rpm package into target_dir."""
|
||||||
pkg_path = os.path.abspath(pkg_path)
|
pkg_path = os.path.abspath(pkg_path)
|
||||||
makedirs(target_dir)
|
makedirs(target_dir)
|
||||||
# rpm2archive writes to stdout only if reading from stdin, thus the redirect
|
try:
|
||||||
run(
|
# rpm2archive writes to stdout only if reading from stdin, thus the redirect
|
||||||
"rpm2archive - <%s | tar xfz - && chmod -R a+rX ." % shlex_quote(pkg_path),
|
run(
|
||||||
workdir=target_dir,
|
"rpm2archive - <%s | tar xfz - && chmod -R a+rX ." % shlex_quote(pkg_path),
|
||||||
)
|
workdir=target_dir,
|
||||||
|
)
|
||||||
|
except RuntimeError:
|
||||||
|
# Fall back to rpm2cpio in case rpm2archive failed (most likely due to
|
||||||
|
# not being present on the system).
|
||||||
|
run(
|
||||||
|
"rpm2cpio %s | cpio -iuvmd && chmod -R a+rX ." % shlex_quote(pkg_path),
|
||||||
|
workdir=target_dir,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def pkg_is_rpm(pkg_obj):
|
def pkg_is_rpm(pkg_obj):
|
||||||
|
Loading…
Reference in New Issue
Block a user