mirror of
git://scm.dxcluster.org/scm/spider
synced 2024-09-21 15:57:12 +00:00
44 lines
881 B
Perl
Executable File
44 lines
881 B
Perl
Executable File
#!/usr/bin/perl
|
|
#
|
|
# create a version and build id for the project using git ids
|
|
#
|
|
# $Id$
|
|
#
|
|
# Copyright (c) 2007 Dirk Koopman, G1TLH
|
|
#
|
|
|
|
# Determine the correct place to put stuff
|
|
BEGIN {
|
|
# root of directory tree for this system
|
|
$root = "/spider";
|
|
$root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
|
|
}
|
|
|
|
use strict;
|
|
|
|
use vars qw($root);
|
|
my $fn = "$root/perl/Version.pm";
|
|
my $desc = `git-describe`;
|
|
my ($v, $s, $b) = $desc =~ /^([\d.]+)(?:\.(\d+))?-(\d+)-/;
|
|
$s ||= '0'; # account for missing subversion
|
|
$b++; # to account for the commit that is about to happen
|
|
|
|
open F, ">$fn" or die "issue.pl: can't open $fn $!\n";
|
|
print F qq(#
|
|
# Version information for DXSpider
|
|
#
|
|
# DO NOT ALTER THIS FILE. It is generated automatically
|
|
# and will be overwritten
|
|
#
|
|
|
|
package main;
|
|
|
|
use vars qw(\$version \$subversion \$build);
|
|
|
|
\$version = '$v';
|
|
\$subversion = '$s';
|
|
\$build = '$b';
|
|
|
|
1;
|
|
);
|