2008-03-22 11:52:18 -04:00
#!/usr/bin/perl
$ version = $ ARGV [ 0 ] ;
2008-04-15 08:20:26 -04:00
if ( $ version eq "--all" or $ version eq "-a" ) {
$ all = 1 ;
$ version = $ ARGV [ 1 ]
}
2010-07-19 02:21:12 -04:00
if ( $ version eq "--only" or $ version eq "-o" ) {
$ only = 1 ;
$ version = $ ARGV [ 1 ]
}
2008-04-14 01:52:18 -04:00
die "No version given" unless $ version =~ /\S/ ;
2008-03-22 11:52:18 -04:00
$ date = `date "+%B %Y"` ; chomp $ date ;
$ year = `date "+%Y"` ; chomp $ year ;
print STDERR "Changing version to \"$version\" and date to \"$date\" in all relevant files\n" ;
2010-07-19 02:21:12 -04:00
if ( not $ only ) {
2008-03-22 11:52:18 -04:00
2010-07-19 02:21:12 -04:00
print STDERR join ( "\n" , glob ( "lisp/*.el" ) ) , "\n" ;
$ cmd = qq{ s/^(;; Version:) \\ s+( \\ S+)[ \ t]* \ $/ \ $1 $version/;s/^( \\ (defconst org-version )"( \\ S+)"/ \ $1"$version"/ } ;
$ c1 = "perl -pi -e '$cmd' lisp/*.el" ;
system ( $ c1 ) ;
2008-03-22 11:52:18 -04:00
2010-07-19 02:21:12 -04:00
print STDERR "doc/org.texi\n" ;
$ cmd = qq{ s/^( \\ \ @set VERSION) \\ s+( \\ S+)[ \ t]* \ $/ \ $1 $version/;s/^( \\ \ @set DATE) \\ s+(.*) \ $/ \ $1 $date/; } ;
$ c1 = "perl -pi -e '$cmd' doc/org.texi" ;
system ( $ c1 ) ;
2008-03-22 11:52:18 -04:00
2010-07-19 07:31:14 -04:00
print STDERR "doc/orgguide.texi\n" ;
$ cmd = qq{ s/^( \\ \ @set VERSION) \\ s+( \\ S+)[ \ t]* \ $/ \ $1 $version/;s/^( \\ \ @set DATE) \\ s+(.*) \ $/ \ $1 $date/; } ;
$ c1 = "perl -pi -e '$cmd' doc/orgguide.texi" ;
system ( $ c1 ) ;
2010-07-19 02:21:12 -04:00
print STDERR "doc/orgcard.tex\n" ;
$ cmd = qq{ s/^ \\ \\ def \\ \\ orgversionnumber \\ { \\ S+ \\ } / \\ \\ def \\ \\ orgversionnumber { $version } /;s/ \\ \\ def \\ \\ versionyear \\ { \\ S+ \\ } / \\ \\ def \\ \\ versionyear { $year } /;s/ \\ \\ def \\ \\ year \\ { \\ S+ \\ } / \\ \\ def \\ \\ year { $year } /; } ;
$ c1 = "perl -pi -e '$cmd' doc/orgcard.tex" ;
system ( $ c1 ) ;
print STDERR "README_DIST\n" ;
$ cmd = qq{ s/^(The version of this release is:) \\ s+( \\ S+)[ \ t]* \ $/ \ $1 $version/; } ;
$ c1 = "perl -pi -e '$cmd' README_DIST" ;
system ( $ c1 ) ;
}
2008-03-22 11:52:18 -04:00
2010-07-19 02:21:12 -04:00
if ( $ all or $ only ) {
2008-04-15 08:20:26 -04:00
print STDERR "ORGWEBPAGE/index.org\n" ;
2009-02-10 14:14:56 -05:00
$ cmd = qq{ s/^( \\ * Current Version ) \\ ( \\ S+? \\ )/ \ $1($version)/;s/^(The current version is) \\ s+( \\ S+) \\ . / \ $1 $version. /;s/org-[6-9].*? \\ .(zip|tar \\ .gz)/org-$version. \ $1/g } ;
2008-04-15 08:20:26 -04:00
$ c1 = "perl -pi -e '$cmd' ORGWEBPAGE/index.org" ;
system ( $ c1 ) ;
}