]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
TokyoCabinet: more BDB checks
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 23 Sep 2010 22:47:46 +0000 (00:47 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Fri, 24 Sep 2010 06:45:02 +0000 (08:45 +0200)
lib/rbot/registry/tc.rb

index ca05ebeb98488278a331fc903659f04880d35147..b4e60d711276010baba787b70269da45e8ff1f6a 100644 (file)
@@ -212,6 +212,10 @@ class Bot
 
     def upgrade_data2
       oldreg = @bot.path 'plugin_registry.db'
+      if not defined? BDB
+        warning "Won't upgrade data: BDB not installed" if File.exist? oldreg
+        return
+      end
       newdir = @bot.path 'registry'
       if File.exist?(oldreg)
         Dir.mkdir(newdir) unless File.exist?(newdir)