[Pkg-mpd-commits] [pkg-mpd] 08/10: Install apport hook from Ubuntu

Florian Schlichting fsfs at moszumanska.debian.org
Sun Dec 29 01:40:33 UTC 2013


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

fsfs pushed a commit to branch master
in repository pkg-mpd.

commit cad14577d309ef44cf2c97eb67204fc822bdd6ef
Author: Florian Schlichting <fsfs at debian.org>
Date:   Sun Dec 29 01:44:58 2013 +0100

    Install apport hook from Ubuntu
---
 debian/copyright     |  4 ++++
 debian/mpd.install   |  1 +
 debian/source_mpd.py | 31 +++++++++++++++++++++++++++++++
 3 files changed, 36 insertions(+)

diff --git a/debian/copyright b/debian/copyright
index f5f12f1..587b5b6 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -130,6 +130,10 @@ Copyright: 2003-2004, Warren Dukes (aka shank) <shank at mercury.chem.pitt.edu>
  2013, Florian Schlichting <fsfs at debian.org>
 License: GPL-2+
 
+Files: debian/source_mpd.py
+Copyright: 2012, Ronny Cardona <rcart19 at gmail.com>
+License: GPL-2+
+
 License: BSD-2-clause
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
diff --git a/debian/mpd.install b/debian/mpd.install
index 50d9cdb..edf175c 100644
--- a/debian/mpd.install
+++ b/debian/mpd.install
@@ -1,3 +1,4 @@
 debian/mpd.conf			etc
 usr/bin/mpd                     usr/bin
 debian/mpd.desktop              etc/xdg/autostart
+debian/source_mpd.py            usr/share/apport/package-hooks
diff --git a/debian/source_mpd.py b/debian/source_mpd.py
new file mode 100644
index 0000000..53ae2d3
--- /dev/null
+++ b/debian/source_mpd.py
@@ -0,0 +1,31 @@
+'''
+apport package hook for Music Player Deamon
+
+Author: Ronny Cardona <rcart19 at gmail.com>
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2 of the License, or (at your
+option) any later version.  See http://www.gnu.org/copyleft/gpl.html for
+the full text of the license.
+'''
+
+from apport.hookutils import *
+import os
+
+# Reference for this function: http://pastebin.ubuntu.com/263396/
+def _my_files(report, filename, keyname):
+    if not (os.path.exists(filename)):
+            return
+    key = keyname 
+    report[key] = ""
+    for line in read_file(filename).split('\n'):
+        try:
+            if 'password' in line.split('"')[0]:
+                line = "%s \"@@APPORTREPLACED@@\" " % (line.split('"')[0])
+            report[key] += line + '\n'
+        except IndexError:
+            continue
+
+def add_info(report):
+       _my_files(report, os.path.expanduser('~/.mpdconf'), 'UserMpdConf')

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



More information about the Pkg-mpd-commits mailing list