Add amsmath as a global LaTeX dependency
[org-mode.git] / mk / set-version.pl
blobd042a6e0294a782fec09e08eab22a5d19d9f4e3b
1 #!/usr/bin/perl
2 $version = $ARGV[0];
3 if ($version eq "--all" or $version eq "-a") {
4 $all = 1;
5 $version = $ARGV[1]
8 if ($version eq "--only" or $version eq "-o") {
9 $only = 1;
10 $version = $ARGV[1]
13 die "No version given" unless $version=~/\S/;
14 $date = `date "+%B %Y"`; chomp $date;
15 $year = `date "+%Y"` ; chomp $year;
17 print STDERR "Changing version to \"$version\" and date to \"$date\" in all relevant files\n" ;
19 if (not $only) {
21 print STDERR join("\n",glob("lisp/*.el")),"\n";
22 $cmd = qq{s/^(;; Version:)\\s+(\\S+)[ \t]*\$/\$1 $version/;s/^(\\(defconst org-version )"(\\S+)"/\$1"$version"/};
23 $c1 = "perl -pi -e '$cmd' lisp/*.el";
24 system($c1);
26 print STDERR "doc/org.texi\n";
27 $cmd = qq{s/^(\\\@set VERSION)\\s+(\\S+)[ \t]*\$/\$1 $version/;s/^(\\\@set DATE)\\s+(.*)\$/\$1 $date/;};
28 $c1 = "perl -pi -e '$cmd' doc/org.texi";
29 system($c1);
31 print STDERR "doc/orgguide.texi\n";
32 $cmd = qq{s/^(\\\@set VERSION)\\s+(\\S+)[ \t]*\$/\$1 $version/;s/^(\\\@set DATE)\\s+(.*)\$/\$1 $date/;};
33 $c1 = "perl -pi -e '$cmd' doc/orgguide.texi";
34 system($c1);
36 print STDERR "doc/orgcard.tex\n";
37 $cmd = qq{s/^\\\\def\\\\orgversionnumber\\{\\S+\\}/\\\\def\\\\orgversionnumber{$version}/;s/\\\\def\\\\versionyear\\{\\S+\\}/\\\\def\\\\versionyear{$year}/;s/\\\\def\\\\year\\{\\S+\\}/\\\\def\\\\year{$year}/;};
38 $c1 = "perl -pi -e '$cmd' doc/orgcard.tex";
39 system($c1);
41 print STDERR "README\n";
42 $cmd = qq{s/^(The version of this release is:)\\s+(\\S+)[ \t]*\$/\$1 $version/;};
43 $c1 = "perl -pi -e '$cmd' README";
44 system($c1);