[sabayon] Temporary Workaround for Mozilla Bug #333479



commit 946d05f53aa9e9106e87c50c9e5894cb88bb945f
Author: Warren Togami <wtogami redhat com>
Date:   Tue Feb 23 13:16:30 2010 -0500

    Temporary Workaround for Mozilla Bug #333479
    
    Delete bookmarks.html created by firefox -createProfile

 lib/sources/mozillasource.py |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/lib/sources/mozillasource.py b/lib/sources/mozillasource.py
index 1dd188a..b0ef31f 100644
--- a/lib/sources/mozillasource.py
+++ b/lib/sources/mozillasource.py
@@ -419,8 +419,18 @@ class MozillaDelegate(userprofile.SourceDelegate):
                 if firefoxpath:
                     subprocess.call ([firefoxpath, "-createProfile", getpass.getuser ()])
                     self.load_profiles_ini()
+                    # XXX: Temporary Workaround for Mozilla Bug #333479
+                    # Delete bookmarks.html created by firefox -createProfile
+                    for profile in self.ini_file.get_profiles():
+                        # There should only be one profile
+                        profile_rel_dir = profile.get_rel_dir()
+                        bogusbookmarks = os.path.join(profile_rel_dir, "bookmarks.html")
+                        if os.path.exists (bogusbookmarks):
+                            dprint (LOG_APPLY, "apply: Remove bogus file %s, see Mozilla Bug #333479.", bogusbookmarks)
+                            os.remove (bogusbookmarks)
+
                 else:
-                    print "Firefox not found in PATH.  Unable to create new profile."
+                    dprint (APPLY, "apply: Firefox not found in PATH.  Unable to create new profile.")
 
         # --------------------
         if sabayon_pref_rel_path in pref_files:
@@ -990,6 +1000,8 @@ gobject.type_register(BookmarkChange)
 
 class BookmarksFile(FirefoxProfileFile):
     def __init__(self, home_dir, rel_path):
+        # XXX: It says it is created, but if it doesn't exist it does not.
+        # Rewrite this when we properly handle sqlite bookmarks.
         dprint(LOG_OPERATION, "BookmarksFile: created (%s)", rel_path)
         FirefoxProfileFile.__init__(self, home_dir, rel_path)
         self.parser = mozilla_bookmarks.BookmarkHTMLParser()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]