lib/version.PL
changeset 92 a09a3ae04dcf
parent 91 75a06e057016
equal deleted inserted replaced
91:75a06e057016 92:a09a3ae04dcf
     1 #! /usr/bin/perl
       
     2 my $outfile = shift;
       
     3 
       
     4 my $now = localtime;
       
     5 chomp(my $version = `hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}\n'`);
       
     6 
       
     7 if (defined $outfile) {
       
     8 	open(STDOUT, '>',  $_ = $outfile) or die "Can't open $_: $!\n";
       
     9 }
       
    10 
       
    11 print <<_;
       
    12 [% # autogenerated at $now by $0
       
    13    # included automatically via PRE_PROCESS
       
    14    vcs.version = "$version";
       
    15 -%]
       
    16 _
       
    17 
       
    18 # zero timestamp does not work! Template/tpage will
       
    19 # complain about "file not found"
       
    20 utime 1, 1 => $outfile