build_version.pl revision dad3168223212d034510b3e0ddbe897737c0812f
#!/usr/local/bin/perl
# HetCATS/utils/pp_test.pl
# $Id$
# Author: Klaus L�ttich
# Year : 2002
# setting up the Version module for hetcats
use strict;
use POSIX qw(strftime);
my $warn = '
Warning:
This File is autogenerated!
Do not edit!
Edit HetCATS/hetcats/Version.in instead!
';
my $version = "<unknown>";
# check Arguments
if (@ARGV == 1) {
open VERS,"<".$ARGV[0] or
die "Coud not open $ARGV[0] for reading";
$version = join "", <VERS>;
close VERS;
$version =~ s/\n//ogs;
$version = '"v'.$version.', '.strftime("%d %b %Y",localtime).'"';
} else {
print STDERR "No version number file given\n";
exit 5;
}
while (<STDIN>) {
s/(Version)\.in/\1.hs/o;
s/>>>HEADER<<</$warn/oe;
s/>>>VERSION<<</$version/oe;
print;
}