diff -Nru kupfer-0+v208/debian/changelog kupfer-0+v208/debian/changelog --- kupfer-0+v208/debian/changelog 2014-06-02 07:29:39.000000000 +0000 +++ kupfer-0+v208/debian/changelog 2014-06-07 17:11:48.000000000 +0000 @@ -1,3 +1,10 @@ +kupfer (0+v208-5) unstable; urgency=medium + + * debian/patches/bookmarks-places.sqlite.patch: + - Fix the error when reading firefox bookmark files (Closes: #749067). + + -- Hugo Lefeuvre Sat, 07 Jun 2014 16:16:36 +0200 + kupfer (0+v208-4) unstable; urgency=low * debian/control: diff -Nru kupfer-0+v208/debian/patches/bookmarks-places.sqlite.patch kupfer-0+v208/debian/patches/bookmarks-places.sqlite.patch --- kupfer-0+v208/debian/patches/bookmarks-places.sqlite.patch 1970-01-01 00:00:00.000000000 +0000 +++ kupfer-0+v208/debian/patches/bookmarks-places.sqlite.patch 2014-06-07 17:11:48.000000000 +0000 @@ -0,0 +1,37 @@ +From: Itaï BEN YAACOV +Subject: Fix the error when reading firefox bookmark files + * Read firefox bookmarks from places.sqlite + +Bug-Debian: http://bugs.debian.org/749067 +Last-Update: 2014-06-07 + +--- kupfer-0+v208.orig/kupfer/plugin/firefox.py ++++ kupfer-0+v208/kupfer/plugin/firefox.py +@@ -65,12 +65,21 @@ class BookmarksSource (AppLeafContentMix + self.output_exc() + + def _get_ffx3_bookmarks(self, fpath): +- """Parse Firefox' .json bookmarks backups""" +- from kupfer.plugin import firefox3_support +- self.output_debug("Parsing", fpath) +- bookmarks = firefox3_support.get_bookmarks(fpath) +- for book in bookmarks: +- yield UrlLeaf(book["uri"], book["title"]) ++ """Query the firefox places bookmark database""" ++ fpath = firefox_support.get_firefox_home_file("places.sqlite") ++ if not (fpath and os.path.isfile(fpath)): ++ return ++ try: ++ self.output_debug("Reading bookmarks from", fpath) ++ with closing(sqlite3.connect(fpath, timeout=1)) as conn: ++ c = conn.cursor() ++ c.execute("""SELECT moz_places.url, moz_bookmarks.title ++ FROM moz_places, moz_bookmarks ++ WHERE moz_places.id = moz_bookmarks.fk""") ++ return [UrlLeaf(url, title) for url, title in c] ++ except sqlite3.Error: ++ # Something is wrong with the database ++ self.output_exc() + + def _get_ffx2_bookmarks(self, fpath): + """Parse Firefox' bookmarks.html""" diff -Nru kupfer-0+v208/debian/patches/series kupfer-0+v208/debian/patches/series --- kupfer-0+v208/debian/patches/series 2014-06-02 07:29:39.000000000 +0000 +++ kupfer-0+v208/debian/patches/series 2014-06-07 17:11:48.000000000 +0000 @@ -4,3 +4,4 @@ tracker-needle.patch locales.patch dbus.patch +bookmarks-places.sqlite.patch