File: highest_symbol_version

package info (click to toggle)
kmod 34.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie, trixie-proposed-updates
  • size: 2,864 kB
  • sloc: ansic: 16,990; makefile: 498; sh: 382; xml: 61; perl: 12
file content (20 lines) | stat: -rw-r--r-- 389 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl
# print the highest package version found in the symbols file read as input

use v5.30;
use warnings;

use Dpkg::Version;

my $highest = 0;
while (<>) {
	my ($version) = /^\s+\S+\s+(\S+)$/;
	next if not $version;
	next if version_compare($highest, $version) == 1;
	$highest = $version;
}

die 'could not find a version number in the input' if not $highest;

say $highest;