[Pkg-dkms-commits] [dkms] 01/02: Upstream post-2.3 cherry-picks for apport (LP: #1661843)

Aron Xu aron at debian.org
Tue Feb 7 15:29:32 UTC 2017


This is an automated email from the git hooks/post-receive script.

aron pushed a commit to branch master
in repository dkms.

commit 0c41b247163caa351be58ee5f20dbeb65d8681b6
Author: Aron Xu <aron at debian.org>
Date:   Tue Feb 7 23:25:45 2017 +0800

    Upstream post-2.3 cherry-picks for apport (LP: #1661843)
    
     - 0010-Fix-ValueError-string-match.patch
     - 0011-Update-the-the-apport.utils-api-change.patch
     - 0012-Include-package-version-in-package-data.patch
---
 .../patches/0010-Fix-ValueError-string-match.patch | 23 ++++++++++++
 ...11-Update-the-the-apport.utils-api-change.patch | 24 +++++++++++++
 ...2-Include-package-version-in-package-data.patch | 41 ++++++++++++++++++++++
 debian/patches/series                              |  3 ++
 4 files changed, 91 insertions(+)

diff --git a/debian/patches/0010-Fix-ValueError-string-match.patch b/debian/patches/0010-Fix-ValueError-string-match.patch
new file mode 100644
index 0000000..2a3c0cc
--- /dev/null
+++ b/debian/patches/0010-Fix-ValueError-string-match.patch
@@ -0,0 +1,23 @@
+From: Brian Murray <brian.murray at canonical.com>
+Date: Tue, 1 Nov 2016 12:30:29 +0800
+Subject: Fix ValueError string match
+
+Apport version 2.5.3 returns the non-existing package name so we need to check
+for that too.
+---
+ dkms_apport.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dkms_apport.py b/dkms_apport.py
+index ebf87fd..774a8b8 100755
+--- a/dkms_apport.py
++++ b/dkms_apport.py
+@@ -52,7 +52,7 @@ if options.kernel:
+     try:
+         supported_kernel = apport.packaging.is_distro_package(kernel_package)
+     except ValueError as e:
+-        if str(e) == 'package does not exist':
++        if str(e) == 'package %s does not exist' % kernel_package:
+             supported_kernel = False
+ 
+     if not supported_kernel:
diff --git a/debian/patches/0011-Update-the-the-apport.utils-api-change.patch b/debian/patches/0011-Update-the-the-apport.utils-api-change.patch
new file mode 100644
index 0000000..a2b3f7d
--- /dev/null
+++ b/debian/patches/0011-Update-the-the-apport.utils-api-change.patch
@@ -0,0 +1,24 @@
+From: Sebastien Bacher <seb128 at ubuntu.com>
+Date: Tue, 1 Nov 2016 12:33:09 +0800
+Subject: Update the the apport.utils api change
+
+https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/1499842
+---
+ dkms_apport.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/dkms_apport.py b/dkms_apport.py
+index 774a8b8..c495967 100755
+--- a/dkms_apport.py
++++ b/dkms_apport.py
+@@ -94,5 +94,8 @@ if 'DKMSBuildLog' in report:
+ 
+ if options.kernel:
+     report['DKMSKernelVersion'] = options.kernel
+-with open(apport.fileutils.make_report_path(report), 'wb') as f:
+-    report.write(f)
++try:
++    with apport.fileutils.make_report_file(report) as f:
++        report.write(f)
++except (IOError, OSError) as e:
++    apport.fatal('Cannot create report: ' + str(e))
diff --git a/debian/patches/0012-Include-package-version-in-package-data.patch b/debian/patches/0012-Include-package-version-in-package-data.patch
new file mode 100644
index 0000000..7fe627b
--- /dev/null
+++ b/debian/patches/0012-Include-package-version-in-package-data.patch
@@ -0,0 +1,41 @@
+From: Brian Murray <brian.murray at canonical.com>
+Date: Tue, 1 Nov 2016 12:35:45 +0800
+Subject: Include package version in package data
+
+Apport includes the package and version in the package data for any report that
+it creates. The Ubuntu Error Tracker expects the data to follow this format,
+and should not have to look up the package version in different fields, so this
+special hook should follow the format.
+---
+ dkms_apport.py | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/dkms_apport.py b/dkms_apport.py
+index c495967..fad0126 100755
+--- a/dkms_apport.py
++++ b/dkms_apport.py
+@@ -62,18 +62,18 @@ if options.kernel:
+ make_log=os.path.join('/var','lib','dkms',options.module,options.version,'build','make.log')
+ 
+ report = apport.Report('Package')
+-report['Package'] = package
+-try:
+-    report['SourcePackage'] = apport.packaging.get_source(package)
+-except ValueError:
+-    sys.stderr.write('ERROR (dkms apport): unable to determine source package for %s\n' % package)
+-    sys.exit(3)
+ try:
+     version = packaging.get_version(package)
+ except ValueError:
+     version = '(not installed)'
+ if version is None:
+     version = '(not installed)'
++report['Package'] = '%s %s' % (package, version)
++try:
++    report['SourcePackage'] = apport.packaging.get_source(package)
++except ValueError:
++    sys.stderr.write('ERROR (dkms apport): unable to determine source package for %s\n' % package)
++    sys.exit(3)
+ 
+ if report['SourcePackage'] == 'fglrx-installer':
+     fglrx_make_log = os.path.join('/var','lib','dkms',options.module,options.version,'build','make.sh.log')
diff --git a/debian/patches/series b/debian/patches/series
index 94dd4c3..9f84387 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,6 @@
 0007-Only-report-fully-linked-weak-installations.patch
 0008-Don-t-assume-boot-config-exists-test-first.patch
 0009-Add-support-for-UEFI-Secure-Boot-validation-toggling.patch
+0010-Fix-ValueError-string-match.patch
+0011-Update-the-the-apport.utils-api-change.patch
+0012-Include-package-version-in-package-data.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-dkms/dkms.git



More information about the Pkg-dkms-commits mailing list