]> git.donarmstrong.com Git - infobot.git/commitdiff
* New VERSION file to keep track of versions
authordjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 18 Oct 2007 13:43:34 +0000 (13:43 +0000)
committerdjmcgrath <djmcgrath@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 18 Oct 2007 13:43:34 +0000 (13:43 +0000)
* 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 [new file with mode: 0644]
src/core.pl
src/modules.pl

diff --git a/VERSION b/VERSION
new file mode 100644 (file)
index 0000000..bc80560
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+1.5.0
index 9efaf417d77b281d0fa338eab57239a142cd2610..9849f52190f79b092f9cf4796fe0b8acdaf65816 100644 (file)
@@ -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, '<VERSION');
+$bot_release   = <VERSION> || "(unknown version)";
+chomp($bot_release);
+close(VERSION);
 $bot_version   = "infobot $bot_release -- $^O";
 $noreply       = 'NOREPLY';
 
index 1da1e1ecc7524ccad427ac204c03bdaf271d7904..b81d31fef4d0428265cd7ae1fd3fa5511a95d337 100644 (file)
@@ -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,"<VERSION");
+    $bot_release = <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) {