summaryrefslogtreecommitdiffstats
path: root/debian/highest_symbol_version
blob: ce6039a59fcee385910d9c6f7faa8b25c4a6af24 (plain)
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;