[Pkg-dkms-commits] [SCM] Dynamic Kernel Module Support branch, master, updated. debian/2.1.1.1-1-4-g4f947d4

David Paleino dapal at debian.org
Mon Feb 8 10:20:10 UTC 2010


The following commit has been merged in the master branch:
commit d56bce9548dc50817d8d1971b46879097022b3b9
Author: David Paleino <dapal at debian.org>
Date:   Mon Feb 8 10:51:39 2010 +0100

    Add -V flag to dh_dkms, thanks to Frédéric Brière <fbriere at fbriere.net> for the patch. (Closes: #568589)

diff --git a/debian/scripts/dh_dkms b/debian/scripts/dh_dkms
index 55e3c49..41673df 100755
--- a/debian/scripts/dh_dkms
+++ b/debian/scripts/dh_dkms
@@ -11,7 +11,7 @@ use Debian::Debhelper::Dh_Lib;
 
 =head1 SYNOPSIS
 
-B<dh_dkms> [S<I<debhelper options>>] [S<B<-l>>] [S<B<--> I<file>>]
+B<dh_dkms> [S<I<debhelper options>>] [S<B<-l>>] [S<B<-V>[I<version>]>] [S<B<--> I<file>>]
 
 =head1 DESCRIPTION
 
@@ -48,6 +48,11 @@ This file can only miss if a filename is provided when calling dh_dkms.
 
 Add code to also support DKMS versions < 2.1.0.0.
 
+=item B<-V>, B<-V> I<version>
+
+Set C<PACKAGE_VERSION> in F<dkms.conf> to the given I<version> or, if none is
+given, default to the upstream version of the current package.
+
 =item B<--> I<file>
 
 Don't look for debian/I<package>.dkms or debian/dkms, but install I<file> as dkms.conf.
@@ -124,6 +129,23 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
 		addsubstvar($package, "misc:Depends", "dkms", ">= 2.1.0.0");
 	}
 
+	if ($dh{V_FLAG_SET}) {
+		$package_version = $dh{V_FLAG};
+		if ($package_version eq "") {
+			# Call isnative because it sets $dh{VERSION}
+			# as a side effect.
+			isnative($package);
+			$package_version = $dh{VERSION};
+			# Remove the Debian revision
+			$package_version =~ s/-[^-]+$//;
+		}
+
+		my $old_name = $name;
+		$name = "debian/".pkgext($package)."dkms.debhelper";
+		doit("cp", "-a", $old_name, $name);
+		doit("sed", "-i", "s/#MODULE_VERSION#/$package_version/g", $name);
+	}
+
 	autoscript($package, "prerm", "prerm-dkms",
 	    "s/#MODULE_NAME#/$package_name/;s/#MODULE_VERSION#/$package_version/");
 	autoscript($package, "postinst", "postinst-dkms",
diff --git a/debian/scripts/dh_dkms.1 b/debian/scripts/dh_dkms.1
index ebeedf5..69f7c84 100644
--- a/debian/scripts/dh_dkms.1
+++ b/debian/scripts/dh_dkms.1
@@ -124,7 +124,7 @@
 .\" ========================================================================
 .\"
 .IX Title "DH_DKMS 1"
-.TH DH_DKMS 1 "2010-01-16" "2.1.1.0" "DKMS Debhelper"
+.TH DH_DKMS 1 "2010-02-08" "2.1.1.0" "DKMS Debhelper"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
@@ -133,7 +133,7 @@
 dh_dkms \- correctly handle DKMS usage by a kernel module package
 .SH "SYNOPSIS"
 .IX Header "SYNOPSIS"
-\&\fBdh_dkms\fR [\fIdebhelper\ options\fR] [\fB\-l\fR] [\fB\-\-\fR\ \fIfile\fR]
+\&\fBdh_dkms\fR [\fIdebhelper\ options\fR] [\fB\-l\fR] [\fB\-V\fR[\fIversion\fR]] [\fB\-\-\fR\ \fIfile\fR]
 .SH "DESCRIPTION"
 .IX Header "DESCRIPTION"
 dh_dkms is a debhelper program that is responsible for correctly setting
@@ -162,6 +162,10 @@ This file can only miss if a filename is provided when calling dh_dkms.
 .IP "\fB\-l\fR, \fB\-\-legacy\fR" 4
 .IX Item "-l, --legacy"
 Add code to also support \s-1DKMS\s0 versions < 2.1.0.0.
+.IP "\fB\-V\fR, \fB\-V\fR \fIversion\fR" 4
+.IX Item "-V, -V version"
+Set \f(CW\*(C`PACKAGE_VERSION\*(C'\fR in \fIdkms.conf\fR to the given \fIversion\fR or, if none is
+given, default to the upstream version of the current package.
 .IP "\fB\-\-\fR \fIfile\fR" 4
 .IX Item "-- file"
 Don't look for debian/\fIpackage\fR.dkms or debian/dkms, but install \fIfile\fR as dkms.conf.

-- 
Dynamic Kernel Module Support



More information about the Pkg-dkms-commits mailing list