diff --git a/patoolib/programs/rpm2cpio.py b/patoolib/programs/rpm2cpio.py index 6944b99..e66482d 100644 --- a/patoolib/programs/rpm2cpio.py +++ b/patoolib/programs/rpm2cpio.py @@ -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', '"*\.\.*"']