File: commitvers

package info (click to toggle)
gnuplot 3.5beta6.347-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 5,032 kB
  • ctags: 4,235
  • sloc: ansic: 42,086; makefile: 561; asm: 539; sh: 386; objc: 379; csh: 297; pascal: 194; perl: 138; lisp: 88
file content (54 lines) | stat: -rwxr-xr-x 1,121 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /usr/bin/perl
#
# $Id: commitvers,v 1.4 1996/02/26 22:21:49 drd Exp $
#
# update version.c and commit gnuplot
#
# this file will not be in any official release
#

if( ! -f "version.c" ) {
  die "Doesn't look like a gnuplot dir to me\n";
}

rename("version.c",".#version.c") || die "Can't move version.c\n";

open(IN, ".#version.c") || die "Can't open version.c.\n";
open(OUT, ">version.c") || die "Can't create version.c\n";

$major="";
$minor="";

while(<IN>) {
  if( /Id: version\.c,v ([0-9]+)\.([0-9]+) / ) {
    $major=$1;
    $minor=$2;
  }
  if( /^(.*patchlevel.*")(alpha |beta |)[^"]*(".*)$/ ) {
    die if( $major eq "" || $minor eq "");
    printf OUT "$1$2%d$3\n", $minor+1;
  } elsif ( /^(.*date.*")[^"]*(".*)$/ ) {
    $date=`date`;
    chop $date;
    print OUT "$1$date$2\n";
  } else {
    print OUT;
  }
}

close IN;
close OUT;

$minor++;

print "New version is $major.$minor\n";

# check in configure.in first, so that we get the new revision number into
# configure

if(system("cvs diff configure.in >/dev/null")) {
  system("cvs commit configure.in");
  system("autoconf");
}

system("cvs commit");