From e625fa02c8ba985d4d929db0792e935c90c19dcf Mon Sep 17 00:00:00 2001 From: minima Date: Mon, 8 Jan 2007 10:33:48 +0000 Subject: [PATCH] change versioning... --- perl/DXUtil.pm | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index b329f51b..2b308407 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -16,11 +16,6 @@ use Data::Dumper; use strict; use vars qw($VERSION $BRANCH); -$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); -$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); -$main::build += $VERSION; -$main::branch += $BRANCH; - use vars qw(@month %patmap @ISA @EXPORT); require Exporter; @@ -30,7 +25,7 @@ require Exporter; filecopy ptimelist print_all_fields cltounix unpad is_callsign is_latlong is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem - is_prefix dd + is_prefix dd dxver ); @@ -440,3 +435,21 @@ sub deleteitem @$list = grep {$_ ne $item } @$list; return $n - @$list; } + +sub dxver +{ + my $s = shift; + my ($a, $b, $c, $d) = $s =~ /(\d+)\.(\d+)\.(?:(\d+)\.(\d+))?/; + + my $v = sprintf( "%d.%03d", $a, $b) || 0; + my $br = sprintf( "%d.%03d", $c, $d) if defined $c; + $br ||= 0; + + $main::build += $v; + $main::branch += $br; + return ($v, $br); +} + +INIT { + ($VERSION, $BRANCH) = dxver(q$Revision$); +} -- 2.43.0