[SCM] mma/master: Patch mma-gb to create its "browserDB" file in ~/.cache/mma/

foka at users.alioth.debian.org foka at users.alioth.debian.org
Sat Sep 19 03:35:32 UTC 2015


The following commit has been merged in the master branch:
commit 768d76e7d868ab3290d2d230afe2ce03c3fcbb23
Author: Anthony Fok <foka at debian.org>
Date:   Thu Sep 17 18:13:15 2015 -0600

    Patch mma-gb to create its "browserDB" file in ~/.cache/mma/
    
    Its upstream original behaviour of creating "browserDB"
    in a system directory like /usr/share/mma/lib/ is problematic.

diff --git a/debian/patches/mma-gb-write-browserDB-to-personal-cache-directory.patch b/debian/patches/mma-gb-write-browserDB-to-personal-cache-directory.patch
new file mode 100644
index 0000000..c4188ef
--- /dev/null
+++ b/debian/patches/mma-gb-write-browserDB-to-personal-cache-directory.patch
@@ -0,0 +1,54 @@
+Description: Patch mma-gb to write browserDB in ~/.cache/mma/ directory
+ instead of writing to /usr/share/mma/lib/browserDB.
+Author: Anthony Fok <foka at debian.org>
+Origin: vendor
+Forwarded: no
+Last-Update: 2015-09-17
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/mma-gb
++++ b/mma-gb
+@@ -67,6 +67,16 @@
+     print("The MMA library directory was not found.")
+     sys.exit(1)
+ 
++if sys.platform.startswith(('linux', 'gnu', 'freebsd', 'netbsd', 'openbsd')):
++    HOME = os.path.expanduser('~')
++    XDG_CACHE_HOME = os.environ.get("XDG_CACHE_HOME", os.path.join(HOME, ".cache"))
++    cachePath = os.path.join(XDG_CACHE_HOME, 'mma')
++else:
++    cachePath = libPath
++
++if not os.path.exists(cachePath):
++    os.makedirs(cachePath)
++
+ # these are the options passed to mma for playing a groove.
+ # they are modified by the entryboxes at the top of screen
+ 
+@@ -514,7 +524,7 @@
+         if not db:
+             print("No data read")
+             sys.exit(1)
+-        write_db(libPath, dbName, db, self.lbdesc)
++        write_db(cachePath, dbName, db, self.lbdesc)
+         self.updateFileList()
+ 
+ 
+@@ -617,7 +627,7 @@
+ 
+ # Start the tk stuff.
+ 
+-db = read_db(libPath, dbName)
++db = read_db(cachePath, dbName)
+ if not db:
+     db = update_groove_db(libPath, '', None)
+ 
+@@ -625,7 +635,7 @@
+         print("No data in database")
+         sys.exit(1)
+ 
+-    write_db(libPath, dbName, db, None)
++    write_db(cachePath, dbName, db, None)
+ 
+ root = Tk()
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..74ab829
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+mma-gb-write-browserDB-to-personal-cache-directory.patch

-- 
mma packaging



More information about the pkg-multimedia-commits mailing list