=== modified file 'softwarecenter/backend/installbackend_impl/aptd.py' --- softwarecenter/backend/installbackend_impl/aptd.py 2012-12-14 16:44:25 +0000 +++ softwarecenter/backend/installbackend_impl/aptd.py 2013-07-01 23:46:09 +0000 @@ -40,7 +40,7 @@ TransactionTypes, PURCHASE_TRANSACTION_ID, ) -from softwarecenter.paths import APPORT_RECOVERABLE_ERROR +from softwarecenter.paths import APPORT_RECOVERABLE_ERROR, APPORT_PACKAGE_ERROR from aptdaemon import client from aptdaemon import enums @@ -876,6 +876,10 @@ # show error if enum == enums.EXIT_FAILED: + if (trans.error and + trans.error.code == enums.ERROR_PACKAGE_MANAGER_FAILED): + pkgname = trans.meta_data["sc_pkgname"] + self._on_trans_error(trans.error, trans, pkgname) # Handle invalid packages separately if (trans.error and trans.error.code == enums.ERROR_INVALID_PACKAGE_FILE): @@ -1046,8 +1050,24 @@ # lintian errors are ignored and not send to apport_recoverable_error # and dpkg errors as well as they will already be recorded separately # by apt itself - if error_code in (enums.ERROR_INVALID_PACKAGE_FILE, - enums.ERROR_PACKAGE_MANAGER_FAILED): + if error_code == enums.ERROR_INVALID_PACKAGE_FILE: + return + + if error_code == enums.ERROR_PACKAGE_MANAGER_FAILED: + # call apport package error + # apt adds the following: + # DpkgTerminalLog DpkgHistoryLog AptOrdering Dmesg Df + # these would all get renamed by apport based off the file name + # e.g. VarLogAptTermlog - we could patch apport too + args = [APPORT_PACKAGE_ERROR, "-p", pkgname, "-l" + "/var/log/apt/term.log"] + p = Popen( + args, stdin=PIPE, stdout=PIPE, stderr=PIPE) + errormsg = "%s failed to install via software-center" % pkgname + (stdout, stderr) = p.communicate(input=errormsg) + if p.returncode != 0: + logging.warn("%s returned '%s' ('%s', '%s')" % ( + APPORT_PACKAGE_ERROR, p.returncode, stdout, stderr)) return # show a apport recoverable error dialog to the user as we want === modified file 'softwarecenter/paths.py' --- softwarecenter/paths.py 2013-01-19 00:00:58 +0000 +++ softwarecenter/paths.py 2013-07-01 16:28:25 +0000 @@ -80,6 +80,7 @@ # apport APPORT_RECOVERABLE_ERROR = "/usr/share/apport/recoverable_problem" +APPORT_PACKAGE_ERROR = "/usr/share/apport/package_hook" # ratings&review