Hooked up the pathfinder so that it seems to work. Animation opcode 0x12.
[scummvm-innocent.git] / tools / update-version.pl
blobec0249c872dea9c674e94b516a28afe3f7f7232b
1 #!/usr/bin/perl
4 # This script is a hack to update the ScummVM version in all (?) files that
5 # contain it. Obviously, it should be used before a release.
7 use strict;
9 if ($#ARGV+1 < 3 or $#ARGV+1 > 4) {
10 # TODO: Allow the user to specify the version as "1.2.3svn"
11 # and automatically split that into 1, 2, 3, svn
12 print STDERR "Usage: $0 MAJOR MINOR PATCH [EXTRA]\n";
13 print STDERR " TODO\n";
14 exit 1;
17 # TODO: Verify that major/minor/patch are actually numbers
18 my $VER_MAJOR = $ARGV[0];
19 my $VER_MINOR = $ARGV[1];
20 my $VER_PATCH = $ARGV[2];
21 my $VER_EXTRA = $ARGV[3];
22 my $VERSION = "$VER_MAJOR.$VER_MINOR.$VER_PATCH$VER_EXTRA";
24 die "MAJOR must be a natural number\n" unless ($VER_MAJOR =~ /^\d+$/);
25 die "MINOR must be a natural number\n" unless ($VER_MINOR =~ /^\d+$/);
26 die "PATCH must be a natural number\n" unless ($VER_PATCH =~ /^\d+$/);
29 print "Setting version to '$VERSION'\n";
32 # List of the files in which we need to perform substitution.
33 my @subs_files = qw(
34 base/internal_version.h
35 dists/redhat/scummvm.spec
36 dists/scummvm.rc
37 dists/slackware/scummvm.SlackBuild
38 dists/wii/meta.xml
39 backends/platform/psp/README.PSP
42 my %subs = (
43 VER_MAJOR => $VER_MAJOR,
44 VER_MINOR => $VER_MINOR,
45 VER_PATCH => $VER_PATCH,
46 VER_EXTRA => $VER_EXTRA,
47 VERSION => $VERSION
50 foreach my $file (@subs_files) {
51 print "Processing $file...\n";
52 open(INPUT, "< $file.in") or die "Can't open '$file.in' for reading: $!\n";
53 open(OUTPUT, "> $file") or die "Can't open '$file' for writing: $!\n";
55 while (<INPUT>) {
56 while (my ($key, $value) = each(%subs)) {
57 s/\@$key\@/$value/;
59 print OUTPUT;
62 close(INPUT);
63 close(OUTPUT);