[Pkg-sugar-commit] [sugar-read-activity] 03/03: Added code for generating empty bookmarks database instead of copying from binary template.

Sebastian Silva icarito-guest at moszumanska.debian.org
Mon Jun 22 18:20:26 UTC 2015


This is an automated email from the git hooks/post-receive script.

icarito-guest pushed a commit to branch master
in repository sugar-read-activity.

commit 2ade337dd08c3217cb4eb005870dcfc6abd56007
Author: Sebastian Silva <sebastian at fuentelibre.org>
Date:   Mon Jun 22 13:19:52 2015 -0500

    Added code for generating empty bookmarks database instead of copying from binary template.
---
 .gitignore                                         |  1 +
 .../1001_create_empty_db_not_copy_template.patch   | 29 ++++++++++++++++++++++
 debian/patches/README                              |  3 +++
 debian/patches/series                              |  1 +
 4 files changed, 34 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..224e7f0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.pc/
diff --git a/debian/patches/1001_create_empty_db_not_copy_template.patch b/debian/patches/1001_create_empty_db_not_copy_template.patch
new file mode 100644
index 0000000..25f28dc
--- /dev/null
+++ b/debian/patches/1001_create_empty_db_not_copy_template.patch
@@ -0,0 +1,29 @@
+--- a/readdb.py
++++ b/readdb.py
+@@ -45,11 +45,21 @@
+ 
+     # Situation 1: DB is non-existent at all
+     if not os.path.exists(dbpath) and not os.path.exists(olddbpath):
+-        try:
+-            os.makedirs(dbdir)
+-        except:
+-            pass
+-        shutil.copy(srcpath, dbpath)
++        # in this case, sqlite3 takes care of things
++        conn = sqlite3.connect(dbpath)
++        conn.execute("""
++        CREATE TABLE "bookmarks"(
++              md5 text,
++              page integer,
++              content text,
++              timestamp real,
++              user text,
++              color text,
++              local integer
++            );""")
++        conn.commit()
++        conn.close()
++
+         return dbpath
+ 
+     # Situation 2: DB is outdated
diff --git a/debian/patches/README b/debian/patches/README
new file mode 100644
index 0000000..80c1584
--- /dev/null
+++ b/debian/patches/README
@@ -0,0 +1,3 @@
+0xxx: Grabbed from upstream development.
+1xxx: Possibly relevant for upstream adoption.
+2xxx: Only relevant for official Debian release.
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..7625424
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+1001_create_empty_db_not_copy_template.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-sugar/sugar-read-activity.git



More information about the pkg-sugar-commit mailing list