[Pkg-dkms-commits] [dkms] 01/07: dh_dkms should fail cleanly with unknown package version or name

Aron Xu aron at debian.org
Tue Jul 5 22:00:55 UTC 2016


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

aron pushed a commit to branch master
in repository dkms.

commit 70d41047d7f4b27a9b6493474bd5e2864000524e
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Thu Jun 30 14:08:49 2016 -0400

    dh_dkms should fail cleanly with unknown package version or name
    
    In some cases, the dkms file is mis-written, or the dh_dkms file
    parsing is too brittle to find the package name or version.
    
    in these cases, dh_dkms proceeds through, but spews errors like the
    following:
    
    Use of uninitialized value $package_version in concatenation (.) or string at /usr/bin/dh_dkms line 150.
    Use of uninitialized value $package_version in concatenation (.) or string at /usr/bin/dh_dkms line 152.
    Use of uninitialized value $package_version in concatenation (.) or string at /usr/bin/dh_dkms line 154.
    
    This patch catches the error and reports it cleanly as an error.
---
 debian/scripts/dh_dkms | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/debian/scripts/dh_dkms b/debian/scripts/dh_dkms
index f2644ad..f5a1c4b 100755
--- a/debian/scripts/dh_dkms
+++ b/debian/scripts/dh_dkms
@@ -147,6 +147,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		doit("sed", "-i", "s/#MODULE_VERSION#/$package_version/g", $name);
 	}
 
+        error "could not determine package name"
+          unless defined($package_name);
+
+        error "could not determine package version"
+          unless defined($package_version);
+
 	autoscript($package, "prerm", "prerm-dkms",
 	    "s/#MODULE_NAME#/$package_name/;s/#MODULE_VERSION#/$package_version/");
 	autoscript($package, "postinst", "postinst-dkms",

-- 
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