]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
TokyoCabinet: only warn about skipped upgrade if the old reg was found
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 23 Sep 2010 20:34:08 +0000 (22:34 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Thu, 23 Sep 2010 20:34:08 +0000 (22:34 +0200)
lib/rbot/registry/tc.rb

index b1b811f7c043490d3f01d4dd491a8e96623f734f..ca05ebeb98488278a331fc903659f04880d35147 100644 (file)
@@ -191,8 +191,8 @@ class Bot
     # NB this function is called _early_ in init(), pretty much all you have to
     # work with is @bot.botclass.
     def upgrade_data
+      oldreg = @bot.path 'registry.db'
       if defined? DBHash
-        oldreg = @bot.path 'registry.db'
         newreg = @bot.path 'plugin_registry.db'
         if File.exist?(oldreg)
           log _("upgrading old-style (rbot 0.9.5 or earlier) plugin registry to new format")
@@ -206,7 +206,7 @@ class Bot
           File.rename(oldreg, oldreg + ".old")
         end
       else
-        warning "Won't upgrade data: BDB not installed"
+        warning "Won't upgrade data: BDB not installed" if File.exist? oldreg
       end
     end