summaryrefslogtreecommitdiff
path: root/make_version_h.pl
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2014-09-13 04:59:04 +0200
committerMarco d'Itri <md@linux.it>2014-09-13 05:27:53 +0200
commit2dc046b070fb751c2bba2b9352b117ac6e836cb7 (patch)
tree4b417d8cc96d17874ac401b5948801da7a84f56c /make_version_h.pl
parent833af3d94aca397255b254e0ca85f4a56881585b (diff)
downloadwhois-2dc046b070fb751c2bba2b9352b117ac6e836cb7.tar.gz
Update make_version_h.pl to support Debian binNMUs
Diffstat (limited to 'make_version_h.pl')
-rwxr-xr-xmake_version_h.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/make_version_h.pl b/make_version_h.pl
index 9eef4a8..06c7841 100755
--- a/make_version_h.pl
+++ b/make_version_h.pl
@@ -2,17 +2,18 @@
use warnings;
use strict;
+use autodie;
my $changelog = $ARGV[0] or die "Usage: $0 debian/changelog\n";
-open(my $fh, '<', $changelog) or die "open($changelog): $!";
+open(my $fh, '<', $changelog);
my $line = <$fh>;
-close($fh) or die "close($changelog): $!";
+close($fh);
my ($ver) = $line =~ /^whois \s+ \( ( [^\)]+ ) \) \s+ \S+/x;
die "Version number not found in $changelog!\n" if not $ver;
-$ver =~ s/ ( ~bpo\d+\+\d+ | ~deb\d+.* | ubuntu\d+ | \+dyson\d+ ) $//x;
+$ver =~ s/ ( ~bpo\d+\+\d+ | \+b\d+ | ~deb\d+.* | ubuntu\d+ | \+dyson\d+ ) $//x;
# The version number must not deviate from this format or the -V option
# to RIPE-like servers will break. If needed, update the previous regexp.