From fd0e69fb63759b857342cbd41c0f27c84fbb8936 Mon Sep 17 00:00:00 2001 From: djmcgrath Date: Thu, 18 Oct 2007 13:43:34 +0000 Subject: [PATCH] * New VERSION file to keep track of versions * Code added to read/reread VERSION on load/reload git-svn-id: https://svn.code.sf.net/p/infobot/code/branches/rebranding@1557 c11ca15a-4712-0410-83d8-924469b57eb5 --- VERSION | 1 + src/core.pl | 9 ++++----- src/modules.pl | 9 ++++++++- 3 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..bc80560 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.5.0 diff --git a/src/core.pl b/src/core.pl index 9efaf41..9849f52 100644 --- a/src/core.pl +++ b/src/core.pl @@ -78,11 +78,10 @@ $nottime = 0; $notsize = 0; $notcount = 0; ### -$bot_release = "1.3.3"; -if ( -d 'CVS' ) { - use POSIX qw(strftime); - $bot_release .= strftime(" cvs (%Y%m%d)", gmtime( (stat('CVS'))[9] ) ); -} +open(VERSION, ' || "(unknown version)"; +chomp($bot_release); +close(VERSION); $bot_version = "infobot $bot_release -- $^O"; $noreply = 'NOREPLY'; diff --git a/src/modules.pl b/src/modules.pl index 1da1e1e..b81d31f 100644 --- a/src/modules.pl +++ b/src/modules.pl @@ -7,7 +7,7 @@ use strict; -use vars qw($AUTOLOAD $no_timehires); +use vars qw($AUTOLOAD $no_timehires $bot_version $bot_release); ### ### REQUIRED MODULES. @@ -157,6 +157,13 @@ sub reloadAllModules { my $retval = ''; &VERB("Module: reloading all.",2); + + # Reload version and save + open(VERSION," || "(unknown version)"; + chomp($bot_release); + $bot_version = "infobot $bot_release -- $^O"; + close(VERSION); # obscure usage of map and regex :) foreach (map { s/.*?\/?src/src/; $_ } keys %moduleAge) { -- 2.39.5