diff -Nru openjdk-8-8u131-b11/debian/apport-hook.py openjdk-8-8u131-b11/debian/apport-hook.py --- openjdk-8-8u131-b11/debian/apport-hook.py 1969-12-31 16:00:00.000000000 -0800 +++ openjdk-8-8u131-b11/debian/apport-hook.py 2017-06-08 12:39:04.000000000 -0700 @@ -0,0 +1,28 @@ +'''Apport package hook for openjdk-8 packages. + +Copyright (C) 2017 Canonical Ltd. +Author: Tiago Stürmer Daitx ''' + +import os +import re +import sys +from apport.hookutils import * + +def add_info(report, ui=None): + attach_conffiles(report,'openjdk-8-jre-headless', ui=ui) + + if report['ProblemType'] == 'Crash' and 'ProcCwd' in report: + # attach hs_err_.pid file + cwd = report['ProcCwd'] + pid_line = re.search("Pid:\t(.*)\n", report["ProcStatus"]) + if pid_line: + pid = pid_line.groups()[0] + path = "%s/hs_err_pid%s.log" % (cwd, pid) + # make sure if exists + if os.path.exists(path): + content = read_file(path) + # only attach if smaller than 100 KB + # see LP: #1696814 + if sys.getsizeof(content) < 100*1024: + report['HotspotError'] = content + report['Tags'] += ' openjdk-hs-err' diff -Nru openjdk-8-8u131-b11/debian/changelog openjdk-8-8u131-b11/debian/changelog --- openjdk-8-8u131-b11/debian/changelog 2017-05-16 14:38:22.000000000 -0700 +++ openjdk-8-8u131-b11/debian/changelog 2017-06-08 17:56:17.000000000 -0700 @@ -1,3 +1,11 @@ +openjdk-8 (8u131-b11-2ubuntu1) artful; urgency=medium + + * debian/apport-hook.py: add an apport hook to include conffiles + modified by the user on any report and the hs_err log file on + crash report only. LP: #1696886. + + -- Tiago Stürmer Daitx Thu, 08 Jun 2017 17:56:17 -0700 + openjdk-8 (8u131-b11-2) unstable; urgency=medium * Tighten dependency on libatk-wrapper-java-jni. Closes: #862508. diff -Nru openjdk-8-8u131-b11/debian/rules openjdk-8-8u131-b11/debian/rules --- openjdk-8-8u131-b11/debian/rules 2017-05-16 14:36:46.000000000 -0700 +++ openjdk-8-8u131-b11/debian/rules 2017-06-08 17:54:54.000000000 -0700 @@ -1779,6 +1779,7 @@ : # $(p_jrehl).install / $(p_jre).install ( \ echo 'etc'; \ + echo 'usr/share/apport/package-hooks'; \ echo '$(basedir)/jre/lib/jexec'; \ echo '$(basedir)/jre/lib/rt.jar'; \ echo '$(basedir)/jre/lib/security/*_policy.jar'; \ @@ -1886,6 +1887,10 @@ echo '$(basedir)/src.zip $(TOP)/$(basename)/'; \ ) > debian/$(p_src).install + : # copy apport hook + mkdir -p $(d)/usr/share/apport/package-hooks/ + cp debian/apport-hook.py $(d)/usr/share/apport/package-hooks/source_openjdk-8.py + : # move demos and samples, create symlinks for $(p_demo) mkdir -p $(d)/usr/share/doc/$(p_jrehl)/demo for i in $(d)/$(basedir)/demo/*; do \