File: kernel-version

package info (click to toggle)
openafs 1.4.2-6etch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 42,324 kB
  • ctags: 55,614
  • sloc: ansic: 397,846; sh: 10,033; makefile: 9,203; perl: 7,679; java: 5,633; asm: 1,276; yacc: 983; lex: 318; tcl: 249; objc: 137; csh: 123
file content (24 lines) | stat: -rw-r--r-- 560 bytes parent folder | download | duplicates (25)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl
#
# Extract the kernel version from the kernel version header file.  Takes the
# kernel source path as its only argument.  If the version header couldn't be
# found, print nothing and exit quietly.

my $ksrc = shift;
unless ($ksrc && open (VERSION, "$ksrc/include/linux/version.h")) {
    exit 0;
}
my $found;
my $line = <VERSION>;
if ($line =~ /"(.+)"/) {
    print "$1\n";
    $found = 1;
}
exit 0 if $found;
unless (open (VERSION, "$ksrc/include/config/kernel.release")) {
    exit 0;
}
if ($line = <VERSION>) {
    print "$line";
}
exit 0;