From: minima Date: Mon, 8 Jan 2007 10:33:48 +0000 (+0000) Subject: change versioning... X-Git-Tag: 1.54~57 X-Git-Url: http://dxspider.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e625fa02c8ba985d4d929db0792e935c90c19dcf;p=spider.git change versioning... --- 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$); +}