Merge branch 'master' into experimental
[pkg-k5-afs_openafs.git] / debian / module / kernel-version
bloba1985a277f7dafd1a73d4dc32d4c362d8f9513c9
1 #!/usr/bin/perl
3 # Extract the kernel version from the kernel version header file. Takes the
4 # kernel source path as its only argument. If the version header couldn't be
5 # found, print nothing and exit quietly.
7 my $ksrc = shift;
8 unless ($ksrc && open (VERSION, "$ksrc/include/linux/version.h")) {
9 exit 0;
11 my $found;
12 my $line = <VERSION>;
13 if ($line =~ /"(.+)"/) {
14 print "$1\n";
15 $found = 1;
17 exit 0 if $found;
18 unless (open (VERSION, "$ksrc/include/config/kernel.release")) {
19 exit 0;
21 if ($line = <VERSION>) {
22 print "$line";
24 exit 0;