add a build number
[spider.git] / cmd / show / version.pl
1 #
2 # show the version number of the software + copyright info
3 #
4 # Copyright (c) 1998 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8
9 my @out;
10 my $build = $main::version;
11
12 if (opendir(DIR, "$main::root/perl")) {
13         my @d = readdir(DIR);
14         closedir(DIR);
15         foreach my $fn (@d) {
16                 if ($fn =~ /^cluster\.pl$/ || $fn =~ /\.pm$/) {
17                         my $f = new IO::File $fn or next;
18                         while (<$f>) {
19                                 if (/^#\s+\$Id:\s+[\w\._]+,v\s+(\d+\.\d+)/ ) {
20                                         $build += $1;
21                                         last;
22                                 }
23                         }
24                         $f->close;
25                 }
26         }
27 }
28 push @out, "DX Spider Cluster version $main::version (build $build) on \u$^O";
29 push @out, "Copyright (c) 1998-2001 Dirk Koopman G1TLH";
30
31 return (1, @out);