diff --git a/PBot/PBot.pm b/PBot/PBot.pm index 5d713cff..53602227 100644 --- a/PBot/PBot.pm +++ b/PBot/PBot.pm @@ -10,15 +10,10 @@ package PBot::PBot; use strict; use warnings; -# These are set automatically by the build/commit script -use constant { - BUILD_NAME => "PBot", - BUILD_REVISION => 140, - BUILD_DATE => "2010-06-04", -}; +use PBot::VERSION; use vars qw($VERSION); -$VERSION = BUILD_NAME . " revision " . BUILD_REVISION . " " . BUILD_DATE; +$VERSION = PBot::VERSION::BUILD_NAME . " revision " . PBot::VERSION::BUILD_REVISION . " " . PBot::VERSION::BUILD_DATE; # unbuffer stdout STDOUT->autoflush(1); diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm new file mode 100644 index 00000000..afa919c6 --- /dev/null +++ b/PBot/VERSION.pm @@ -0,0 +1,20 @@ +# File: VERSION.pm +# Author: pragma_ +# +# Purpose: Keeps track of bot version. + +# $Id$ + +package PBot::VERSION; + +use strict; +use warnings; + +# These are set automatically by the build/commit script +use constant { + BUILD_NAME => "PBot", + BUILD_REVISION => 141, + BUILD_DATE => "2010-06-04", +}; + +1; diff --git a/build/update-version.pl b/build/update-version.pl index 127e116f..62c41b0d 100755 --- a/build/update-version.pl +++ b/build/update-version.pl @@ -13,11 +13,11 @@ $rev++; print "New version: $rev $date\n"; -open my $in, '<', "PBot/PBot.pm" or die "Couldn't open PBot.pm for reading: $!"; +open my $in, '<', "PBot/VERSION.pm" or die "Couldn't open VERSION.pm for reading: $!"; my @lines = <$in>; close $in; -open my $out, '>', "PBot/PBot.pm" or die "Couldn't open PBot.pm for writing: $!"; +open my $out, '>', "PBot/VERSION.pm" or die "Couldn't open VERSION.pm for writing: $!"; foreach my $text (@lines) { $text =~ s/BUILD_NAME\s+=> ".*",/BUILD_NAME => "PBot",/;