mirror of
https://git.proxmox.com/git/fwupd
synced 2026-03-28 06:44:38 +00:00
* Change dependency versioning strategy for the signed fwupd packages to make them binNMU friendly. Closes: #973715 * Similarly change versioning used for Built-Using. Closes: #992910
39 lines
749 B
Perl
Executable File
39 lines
749 B
Perl
Executable File
#!/usr/bin/perl
|
|
#
|
|
# Helper script to work out the current *and next* version of the
|
|
# package.
|
|
|
|
use warnings;
|
|
use strict;
|
|
|
|
# Grab current version from the changelog
|
|
my $this_version = `dpkg-parsechangelog --show-field Version`;
|
|
chomp $this_version;
|
|
|
|
# Remove any trailing +b - ignore binNMUs
|
|
$this_version =~ s/\+b\d+$//;
|
|
|
|
# Code borrowed from dch for incrementing a version number, let's
|
|
# assume it works!
|
|
$this_version =~ /^(.*?)([a-yA-Y][a-zA-Z]*|\d*)$/;
|
|
my $end = $2;
|
|
if ($end eq '') {
|
|
die "Cannot determine new Debian revision; abort\n";
|
|
}
|
|
$end++;
|
|
my $next_version = "$1$end";
|
|
|
|
if (scalar(@ARGV) == 1) {
|
|
my $arg = shift;
|
|
if ($arg eq "--next") {
|
|
print "$next_version\n";
|
|
exit 0;
|
|
}
|
|
}
|
|
|
|
# else
|
|
|
|
print "$this_version\n";
|
|
exit 0;
|
|
|