~jesse-imaginaryrobots/software-center/software-center

« back to all changes in this revision

Viewing changes to softwarecenter/backend/installbackend_impl/aptd.py

  • Committer: Michael Vogt
  • Date: 2012-10-18 08:40:13 UTC
  • mfrom: (3234.2.3 5.4)
  • Revision ID: michael.vogt@ubuntu.com-20121018084013-0s7ytzjtqlod0fo6
mergeĀ fromĀ stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1008
1008
        if pkgname and pkgname in self.pending_transactions:
1009
1009
            del self.pending_transactions[pkgname]
1010
1010
 
 
1011
        # calculate a dupes_signature here to have different buckets
 
1012
        # on errors.ubuntu.com for the different crash types
 
1013
        dupes_signature = "software-center:trans-failed:%s" % trans.error_code
 
1014
 
1011
1015
        self.emit("transaction-stopped", result)
1012
1016
        if isinstance(error, dbus.DBusException):
1013
1017
            # ignore errors that the user knows about already (like
1025
1029
                         "the authentication service is not available. "
1026
1030
                         "(%s") % error
1027
1031
                # send to apport for reporting
1028
 
                self._call_apport_recoverable_error(text, error)
 
1032
                self._call_apport_recoverable_error(
 
1033
                    text, error, dupes_signature)
1029
1034
                # ... and display as a dialog
1030
1035
                self.ui.error(None, summary, text)
1031
1036
                return
1032
1037
 
1033
1038
        # lintian errors are ignored and not send to apport_recoverable_error
1034
 
        if trans.error_code == enums.ERROR_INVALID_PACKAGE_FILE:
 
1039
        # and dpkg errors as well as they will already be recorded seperately
 
1040
        # by apt itself
 
1041
        if trans.error_code in (enums.ERROR_INVALID_PACKAGE_FILE,
 
1042
                                enums.ERROR_PACKAGE_MANAGER_FAILED):
1035
1043
            return
1036
1044
 
1037
1045
        # show a apport recoverable error dialog to the user as we want
1038
1046
        # to know about these issues
1039
1047
        self._call_apport_recoverable_error(
1040
 
            _("There was an error submitting the transaction"), error)
 
1048
            _("There was an error submitting the transaction"),
 
1049
            error,
 
1050
            dupes_signature)
1041
1051
 
1042
 
    def _call_apport_recoverable_error(self, text, error):
 
1052
    def _call_apport_recoverable_error(self, text, error, dupes_signature):
1043
1053
        """Call apports recoverable_problem dialog """
1044
1054
 
1045
1055
        # ensure we have a proper expection string in the report
1048
1058
 
1049
1059
        # mvo: I don't think we need to send "Package\0software-center",
1050
1060
        #      apport should figure this out itself
1051
 
        data = "DialogBody\0%(text)s\0Traceback\0%(error)s" % {
 
1061
        data = ("DialogBody\0%(text)s\0"
 
1062
                "Traceback\0%(error)s\0"
 
1063
                "DuplicateSignature\0%(dupes_signature)s" % {
1052
1064
                'text': text,
1053
1065
                'error': error,
1054
 
                }
 
1066
                'dupes_signature': dupes_signature,
 
1067
                })
1055
1068
        # This will be quick as it just writes the report file. Then
1056
1069
        # the report gets picked up asynchronously by a inotify watch
1057
1070
        # and displayed to the user in a seperate process.