2006-01-25 20:53:25 +00:00
|
|
|
#!/usr/bin/perl
|
|
|
|
|
|
|
|
#
|
|
|
|
# This script is a hack to update the ScummVM version in all (?) files that
|
|
|
|
# contain it. Obviously, it should be used before a release.
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
if ($#ARGV+1 < 3 or $#ARGV+1 > 4) {
|
2006-02-15 23:23:54 +00:00
|
|
|
# TODO: Allow the user to specify the version as "1.2.3svn"
|
|
|
|
# and automatically split that into 1, 2, 3, svn
|
2006-01-25 20:53:25 +00:00
|
|
|
print STDERR "Usage: $0 MAJOR MINOR PATCH [EXTRA]\n";
|
|
|
|
print STDERR " TODO\n";
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
# TODO: Verify that major/minor/patch are actually numbers
|
|
|
|
my $VER_MAJOR = $ARGV[0];
|
|
|
|
my $VER_MINOR = $ARGV[1];
|
|
|
|
my $VER_PATCH = $ARGV[2];
|
|
|
|
my $VER_EXTRA = $ARGV[3];
|
|
|
|
my $VERSION = "$VER_MAJOR.$VER_MINOR.$VER_PATCH$VER_EXTRA";
|
|
|
|
|
|
|
|
die "MAJOR must be a natural number\n" unless ($VER_MAJOR =~ /^\d+$/);
|
|
|
|
die "MINOR must be a natural number\n" unless ($VER_MINOR =~ /^\d+$/);
|
|
|
|
die "PATCH must be a natural number\n" unless ($VER_PATCH =~ /^\d+$/);
|
|
|
|
|
|
|
|
|
|
|
|
print "Setting version to '$VERSION'\n";
|
|
|
|
|
|
|
|
|
|
|
|
# List of the files in which we need to perform substitution.
|
|
|
|
my @subs_files = qw(
|
|
|
|
base/internal_version.h
|
|
|
|
dists/redhat/scummvm.spec
|
2010-04-04 19:04:57 +00:00
|
|
|
dists/redhat/scummvm-tools.spec
|
2007-06-18 12:58:15 +00:00
|
|
|
dists/slackware/scummvm.SlackBuild
|
2009-08-07 18:16:58 +00:00
|
|
|
dists/macosx/Info.plist
|
2016-03-20 21:27:47 +00:00
|
|
|
dists/macosx/dockplugin/Info.plist
|
2009-08-07 18:16:58 +00:00
|
|
|
dists/iphone/Info.plist
|
2016-01-06 08:36:39 +00:00
|
|
|
dists/ios7/Info.plist
|
2010-05-16 18:02:59 +00:00
|
|
|
dists/irix/scummvm.spec
|
2009-06-17 23:36:00 +00:00
|
|
|
dists/wii/meta.xml
|
2010-06-06 09:34:36 +00:00
|
|
|
dists/android/AndroidManifest.xml
|
2012-01-22 16:51:11 +00:00
|
|
|
dists/openpandora/PXML.xml
|
|
|
|
dists/openpandora/README-OPENPANDORA
|
|
|
|
dists/openpandora/README-PND.txt
|
|
|
|
dists/openpandora/index.html
|
|
|
|
dists/gph/README-GPH
|
|
|
|
dists/gph/scummvm.ini
|
2017-11-19 11:44:21 +00:00
|
|
|
dists/riscos/!Boot,feb
|
2019-06-06 12:46:11 +00:00
|
|
|
dists/amiga/RM2AG.rexx
|
2009-02-20 17:29:22 +00:00
|
|
|
backends/platform/psp/README.PSP
|
2017-11-23 17:50:28 +00:00
|
|
|
snapcraft.yaml
|
2006-01-25 20:53:25 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
my %subs = (
|
|
|
|
VER_MAJOR => $VER_MAJOR,
|
|
|
|
VER_MINOR => $VER_MINOR,
|
|
|
|
VER_PATCH => $VER_PATCH,
|
|
|
|
VER_EXTRA => $VER_EXTRA,
|
2010-11-19 16:47:03 +00:00
|
|
|
VERSION => $VERSION
|
2006-01-25 20:53:25 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
foreach my $file (@subs_files) {
|
|
|
|
print "Processing $file...\n";
|
|
|
|
open(INPUT, "< $file.in") or die "Can't open '$file.in' for reading: $!\n";
|
|
|
|
open(OUTPUT, "> $file") or die "Can't open '$file' for writing: $!\n";
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-01-25 20:53:25 +00:00
|
|
|
while (<INPUT>) {
|
|
|
|
while (my ($key, $value) = each(%subs)) {
|
|
|
|
s/\@$key\@/$value/;
|
|
|
|
}
|
|
|
|
print OUTPUT;
|
|
|
|
}
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-01-25 20:53:25 +00:00
|
|
|
close(INPUT);
|
|
|
|
close(OUTPUT);
|
|
|
|
}
|