use no of commits as the build no on a tag
[spider.git] / perl / issue.pl
1 #!/usr/bin/perl
2 #
3 # create a version and build id for the project using git ids
4 #
5 # $Id$
6 #
7 # Copyright (c) 2007 Dirk Koopman, G1TLH
8 #
9
10 # Determine the correct place to put stuff
11 BEGIN {
12         # root of directory tree for this system
13         $root = "/spider";
14         $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
15 }
16
17 use strict;
18
19 use vars qw($root);
20 my $fn = "$root/perl/Version.pm";
21 my $desc = `git-describe`;
22 my ($v, $b) = $desc =~ /^([\d.]+)-(\d+)-/;
23 $b++;                   # to account for the commit that is about to happen
24
25 open F, ">$fn" or die "issue.pl: can't open $fn $!\n";
26 print F qq(#
27 # Version information for DXSpider
28 #
29 # DO NOT ALTER THIS FILE. It is generated automatically
30 # and will be overwritten
31 #
32
33 package main;
34
35 use vars qw(\$version \$build);
36
37 \$version = '$v';
38 \$build = '$b';
39
40 1;
41 );