Allow synonyms for localhost
[spider.git] / perl / issue.pl
index 6d2bfd34a9856fa1d8691659c464ded3ff919631..fd09e8594e3b2a983cbc9c368151e9d4a288f8f6 100755 (executable)
@@ -1,8 +1,8 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
 #
 # create a version and build id for the project using git ids
 #
-# $Id$
+#
 #
 # Copyright (c) 2007 Dirk Koopman, G1TLH
 #
@@ -18,8 +18,8 @@ use strict;
 
 use vars qw($root);
 my $fn = "$root/perl/Version.pm";
-my $desc = `git-describe`;
-my ($v, $b) = $desc =~ /^([\d.]+)-(\d+)-/;
+my $desc = `git describe --long`;
+my ($v, $s, $b, $g) = $desc =~ /^([\d.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/;
 $b++;                  # to account for the commit that is about to happen
 
 open F, ">$fn" or die "issue.pl: can't open $fn $!\n";
@@ -32,10 +32,13 @@ print F qq(#
 
 package main;
 
-use vars qw(\$version \$build);
+use vars qw(\$version \$build \$gitversion);
 
 \$version = '$v';
 \$build = '$b';
+\$gitversion = '$g\[i]';
 
 1;
 );
+
+exit(0);