[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH kernel-wedge 2/3] Allow kernel ABI version to be specified as command-line argument



When building as part of a kernel source package, the kernel ABI
version used should always be the current one.  The 'installed name'
changes with the kernel ABI version but is also quite regular.
Neither of these should need to be specified redundantly in
configuration files.

gen-control, install-files: Allow the version to be specified as a
command-line argument, overriding the configuration file.  In this
case, the configuration file should specify '-'.  Allow the installed
name to be specified as '-', and in that case generate it
automatically.
---
 commands/gen-control   |    7 +++++++
 commands/install-files |   12 ++++++++++++
 debian/changelog       |    1 +
 3 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/commands/gen-control b/commands/gen-control
index f1b742d..764144d 100755
--- a/commands/gen-control
+++ b/commands/gen-control
@@ -11,6 +11,8 @@ my %packages;
 my @builddeps;
 my %excluded;
 
+my $fixkernelversion = $ARGV[0];
+
 if (open(EXCLUDED, "exclude-packages")) {
 	while (<EXCLUDED>) {
 		chomp;
@@ -28,6 +30,11 @@ while (<KVERS>) {
 	if (! length $arch || ! length $kernelversion || ! length $flavour) {
 		die "parse error";
 	}
+	if (defined($fixkernelversion)) {
+		$kernelversion = $fixkernelversion;
+	} elsif ($kernelversion eq "-") {
+		die "kernel version not set in file or on command line";
+	}
 	push @versions, [ $arch, $kernelversion, $flavour ];
 	if ($builddep ne "-") {
 		foreach my $pkg (split(", ", $builddep)) {
diff --git a/commands/install-files b/commands/install-files
index 482fbeb..3cabf86 100755
--- a/commands/install-files
+++ b/commands/install-files
@@ -14,6 +14,8 @@ chomp $hostarch;
 
 my $fixsourcedir = $ENV{SOURCEDIR};
 
+my $fixkernelversion = $ARGV[0];
+
 open(KVERS, "kernel-versions") || die "kernel-versions: $!";
 my $version = 0;
 while (<KVERS>) {
@@ -28,6 +30,16 @@ while (<KVERS>) {
 	}
 	next unless $arch eq $hostarch;
 
+	if (defined($fixkernelversion)) {
+		$kernelversion = $fixkernelversion;
+	} elsif ($kernelversion eq "-") {
+		die "kernel version not set in file or on command line";
+	}
+
+	if ($installedname eq "-") {
+		$installedname = "$kernelversion-$flavour";
+	}
+
 	my $sourcedir;
 	if (defined $fixsourcedir) {
 		$sourcedir = $fixsourcedir;
diff --git a/debian/changelog b/debian/changelog
index 4cfaab0..9cc2682 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,7 @@ kernel-wedge (2.79) UNRELEASED; urgency=low
 
   [ Ben Hutchings ]
   * Allow kernel source packages to use kernel-wedge on themselves
+  * Allow kernel ABI version to be specified as command-line argument
 
  -- Samuel Thibault <sthibault@debian.org>  Mon, 08 Aug 2011 18:34:12 +0200
 
-- 
1.7.5.4



Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: