From 084c4ffd3dc4b824e315f17aba9024464143491a Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Thu, 11 Mar 2010 15:54:01 +0100 Subject: [PATCH] Check for cpio when extracting output from rpm2cpio. --- patoolib/programs/rpm2cpio.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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', '"*\.\.*"']