File gwibber-sqlite-migrate-opensuse.diff of Package gwibber

Index: gwibber-3.3.4/gwibber/microblog/util/const.py
===================================================================
--- gwibber-3.3.4.orig/gwibber/microblog/util/const.py
+++ gwibber-3.3.4/gwibber/microblog/util/const.py
@@ -25,6 +25,13 @@ SQLITE_DB_FILENAME = "%s/gwibber.sqlite"
 if not isdir(cache_dir): makedirs(cache_dir)
 if not isdir(config_dir): makedirs(config_dir)
 
+import os.path
+if not os.path.exists(SQLITE_DB_FILENAME):
+  OLD_DB_FILENAME = os.path.join(CACHE_DIR, "gwibber.sqlite")
+  if os.path.exists (OLD_DB_FILENAME):
+    import shutil
+    shutil.copyfile(OLD_DB_FILENAME, SQLITE_DB_FILENAME)
+
 GWIBBER_TEST_DUMP = None
 if environ.has_key("GWIBBER_TEST_DUMP"):
   GWIBBER_TEST_DUMP = environ["GWIBBER_TEST_DUMP"]
openSUSE Build Service is sponsored by