Update librte-pmd-bond1.symbols with new symbol.
[deb_dpdk.git] / debian / kernel-version
1 #!/usr/bin/perl
2 #
3 # Copyright (c)  2009-2016 Andreas Beckmann <anbe@debian.org>
4 #                2010-2016 Russ Allbery <rra@debian.org>
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this script.  If not, see <http://www.gnu.org/licenses/>.
18 #
19 # This program comes from:
20 # https://anonscm.debian.org/viewvc/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/module/debian/kernel-version?view=markup
21 # The original copyright and license (GPL2+) can be found at:
22 # https://anonscm.debian.org/viewvc/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/copyright?view=markup
23 #
24 # Extract the kernel version from the kernel version header file.  Takes the
25 # kernel source path as its only argument.  If the version header couldn't be
26 # found, print nothing and exit quietly.
27
28 use warnings;
29
30 my $ksrc = shift;
31 unless ($ksrc && (-f "$ksrc/include/linux/version.h" || -f "$ksrc/include/generated/uapi/linux/version.h")) {
32     exit 0;
33 }
34 my $found = 0;
35 my $line;
36 if (open (VERSION, "$ksrc/include/linux/version.h")) {
37     if (defined(VERSION) && ($line = <VERSION>)) {
38         if ($line =~ /"(.+)"/) {
39             print "$1\n";
40             $found = 1;
41         }
42     }
43 }
44 exit 0 if $found;
45 if (open (VERSION, "$ksrc/include/generated/utsrelease.h")) {
46     if (defined(VERSION) && ($line = <VERSION>)) {
47         if ($line =~ /UTS_RELEASE *"(.+)"/) {
48             print "$1\n";
49             $found = 1;
50         }
51     }
52 }
53 exit 0 if $found;
54 # kernel.release is no longer useful since 3.1.0
55 unless (open (VERSION, "$ksrc/include/config/kernel.release")) {
56     exit 0;
57 }
58 if (defined(VERSION) && ($line = <VERSION>)) {
59     print "$line";
60 }
61 exit 0;