]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
database: rbot will now refuse to run on bdb versions lower than 4.x, and it will...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 9 Apr 2007 21:46:41 +0000 (21:46 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 9 Apr 2007 21:46:41 +0000 (21:46 +0000)
lib/rbot/dbhash.rb

index b32da5004fdf34265f5d15d7a119a4f2d4b86d58..d793e27e786b854d7d7f119de87ab46d78a53958 100644 (file)
@@ -6,6 +6,18 @@ rescue Exception => e
   exit 2
 end
 
+if BDB::VERSION_MAJOR < 4
+  fatal "Your bdb (Berkeley DB) version #{BDB::VERSION} is too old!"
+  fatal "rbot will only run with bdb version 4 or higher, please upgrade."
+  fatal "For maximum reliability, upgrade to version 4.2 or higher."
+  raise BDB::Fatal, BDB::VERSION + " is too old"
+end
+
+if BDB::VERSION_MAJOR == 4 and BDB::VERSION_MINOR < 2
+  warning "Your bdb (Berkeley DB) version #{BDB::VERSION} may not be reliable."
+  warning "If possible, try upgrade version 4.2 or later."
+end
+
 # make BTree lookups case insensitive
 module BDB
   class CIBtree < Btree