From 00c143ce3432f9b78a1fa4a37a3c672746e2e138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6k=C3=A7en=20Eraslan?= Date: Sun, 4 Jan 2009 10:43:14 +0000 Subject: [PATCH] Check return value of the given command of shelltools.system, raise exception if it is not equal to zero. This also effects methods using system, like domo, dobin, doman etc. --- pisi/actionsapi/shelltools.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pisi/actionsapi/shelltools.py b/pisi/actionsapi/shelltools.py index e9641774..56075c44 100644 --- a/pisi/actionsapi/shelltools.py +++ b/pisi/actionsapi/shelltools.py @@ -242,4 +242,10 @@ def dirName(filePath): def system(command): command = string.join(string.split(command)) - return run_logged(command) + retValue = run_logged(command) + + #if return value is different than 0, it means error, raise exception + if retValue != 0: + error(_("Command \"%s\" failed, return value was %d." % (command, retValue))) + + return retValue