=== modified file 'data/general-hooks/ubuntu.py' --- data/general-hooks/ubuntu.py 2012-07-19 14:50:22 +0000 +++ data/general-hooks/ubuntu.py 2012-07-20 18:19:39 +0000 @@ -54,8 +54,17 @@ for log in ['DpkgTerminalLog', 'VarLogDistupgradeApttermlog']: if log in report: + untrimmed_dpkg_log = report[log] check_attachment_for_errors(report, log) + trimmed_log = report['DpkgTerminalLog'].split('\n') + lines = [] + for line in untrimmed_dpkg_log.decode('UTF-8').splitlines(): + if line not in trimmed_log: + lines.append(line) + elif line in trimmed_log: + trimmed_log.remove(line) + dpkg_log_without_error = '\n'.join(lines) # crash reports from live system installer often expose target mount for f in ('ExecutablePath', 'InterpreterPath'): if f in report and report[f].startswith('/target/'): @@ -89,8 +98,10 @@ # build a duplicate signature tag for package reports if report.get('ProblemType') == 'Package': if 'DpkgTerminalLog' in report: + # this was previously trimmed in check_attachment_for_errors termlog = report['DpkgTerminalLog'] elif 'VarLogDistupgradeApttermlog' in report: + # this was previously trimmed in check_attachment_for_errors termlog = report['VarLogDistupgradeApttermlog'] else: termlog = None @@ -119,6 +130,9 @@ report['DuplicateSignature'] = dupe_sig # the duplicate signature should be the first failure break + if dupe_sig: + if dpkg_log_without_error.find(dupe_sig) != -1: + report['UnreportableReason'] = _('You have already encountered this package installation failure.') # running Unity? username = pwd.getpwuid(os.geteuid()).pw_name @@ -364,7 +378,7 @@ if start_re.match(line) or trim_re.match(line): lines = [] continue - lines.append(str(line)) + lines.append(line.decode('UTF-8')) report['DpkgTerminalLog'] = '\n'.join(lines) if not report['DpkgTerminalLog'].strip():