Check for cpio when extracting output from rpm2cpio.

This commit is contained in:
Bastian Kleineidam 2010-03-11 15:54:01 +01:00
parent 5ad18595bd
commit 084c4ffd3d
1 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,11 @@ from patoolib import util
def extract_rpm (archive, encoding, cmd, **kwargs):
"""Extract a DEB archive."""
cmdlist = [cmd, os.path.abspath(archive), "|", 'cpio', '--extract',
# also check cpio
cpio = util.find_program("cpio")
if not cpio:
raise util.PatoolError("cpio(1) is required for rpm2cpio extraction; please install it")
cmdlist = [cmd, os.path.abspath(archive), "|", cpio, '--extract',
'--make-directories', '--preserve-modification-time',
'--no-absolute-filenames', '--force-local', '--nonmatching',
'"*\.\.*"']