From d2f814426fc5bae6315daea3feb8a3f8a2a9efd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Sat, 5 Nov 2011 14:54:57 -0300 Subject: Add logCtrl for scripts that might fail from a thp --- lib/thandy/packagesys/ThpPackages.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/thandy/packagesys/ThpPackages.py') diff --git a/lib/thandy/packagesys/ThpPackages.py b/lib/thandy/packagesys/ThpPackages.py index f82415e..4745767 100644 --- a/lib/thandy/packagesys/ThpPackages.py +++ b/lib/thandy/packagesys/ThpPackages.py @@ -16,6 +16,8 @@ import thandy.formats import thandy.packagesys.PackageSystem as PS import thandy.packagesys.PackageDB as PDB +from thandy.util import logCtrl + json = thandy.util.importJSON() class ThpDB(object): @@ -184,15 +186,18 @@ class ThpTransaction(PS.Transaction): for pkg in order: if pkg.run('checkinst') != 0: logging.info("Check inst failed for %s" % pkg) + logCtrl("ERROR", SCRIPT="checkinst") sys.exit(1) for pkg in order: logging.info("Starting installation using %s" % pkg) if pkg.run('preinst') != 0: logging.info("Preinst script for %s failed" % pkg) + logCtrl("ERROR", SCRIPT="preinst") sys.exit(1) pkg.install() if pkg.run('postinst') != 0: logging.info("postinst script failed") + logCtrl("ERROR", SCRIPT="postinst") except AlreadyLocked: print "You can't run more than one instance of Thandy" except LockFailed: -- cgit v1.2.3