Merge lp:~rcart/ubuntu/precise/mpd/fix-947551 into lp:ubuntu/precise/mpd

Proposed by Ronny Cardona on 2012-03-08
Status: Merged
Merged at revision: 53
Proposed branch: lp:~rcart/ubuntu/precise/mpd/fix-947551
Merge into: lp:ubuntu/precise/mpd
Diff against target: 50 lines (+38/-0)
2 files modified
debian/changelog (+7/-0)
debian/ (+31/-0)
To merge this branch: bzr merge lp:~rcart/ubuntu/precise/mpd/fix-947551
Reviewer Review Type Date Requested Status
Daniel Holbach Approve on 2012-03-16
Ubuntu branches 2012-03-08 Pending
Review via email:

Description of the change

* debian/
  - Added apport hook to include user configuration file. (LP: #947551)

To post a comment you must log in.
Daniel Holbach (dholbach) wrote :

Did you test this? According to the config file format does not contain any use of "=".

Also if you should choose to use GPL3+ (which is totally fine), this needs to be documented in debian/copyright.

Thanks for your work on this!

review: Needs Information
Ronny Cardona (rcart) wrote :

1. Yes, I tested it using 'ubuntu-bug mpd' and checking the report. The 'MpdUserConf' key was attached with the user configuration file overwriting the password field, if any.

2. Right. As you can see in the file ( I'm using '"' to find the password value, and then, replace it with '@@APPORTREPACLACED@@':
                if 'password' in line.split('"')[0]:
                    line = "%s \"@@APPORTREPLACED@@\" " % (line.split('"')[0])

3. There's already a copyright file in debian/copyright. What you mean by documented?

Thanks for your time.

Daniel Holbach (dholbach) wrote :

Ah, regarding 1. and 2. That's fine. Sorry, I misread the code.

Regarding 3.: Do you think you can add something to debian/copyright about your file being under a different license?

Ronny Cardona (rcart) wrote :

Is the same version (well, mpd is GPL2+ which includes GPL3). Isn't it?

Daniel Holbach (dholbach) wrote :

Yes, but yours is GPL3+ only, not GPL2+.

Ronny Cardona (rcart) wrote :

You're right. Hook updated to GPL2+.

BTW, what if I would like to release it in GPL3+? Or just GPL?

Daniel Holbach (dholbach) wrote :

If you want to have it GPL3+ exclusively, you just need to document it in debian/copyright.

Ronny Cardona (rcart) wrote :

Oh, great. Thanks for clarify.

Daniel Holbach (dholbach) wrote :

Good work. Thanks for choosing GPL2+, this will allow us to use the same debian/copyright as the package in Debian.

I took the liberty of adding this line to debian/mpd.install to make sure the hook gets installed:

debian/ usr/share/apport/package-hooks

review: Approve
Ronny Cardona (rcart) wrote :

Awesome! I didn't know that. Thank you.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-03-04 00:11:01 +0000
3+++ debian/changelog 2012-03-16 17:20:23 +0000
4@@ -1,3 +1,10 @@
5+mpd (0.16.5-1ubuntu4) precise; urgency=low
7+ * debian/
8+ - Added apport hook to include user configuration file. (LP: #947551)
10+ -- Ronny Cardona <> Wed, 07 Mar 2012 18:03:12 -0600
12 mpd (0.16.5-1ubuntu3) precise; urgency=low
14 * debian/mpd.init.d:
16=== added file 'debian/'
17--- debian/ 1970-01-01 00:00:00 +0000
18+++ debian/ 2012-03-16 17:20:23 +0000
19@@ -0,0 +1,31 @@
21+apport package hook for Music Player Deamon
23+Author: Ronny Cardona <>
25+This program is free software; you can redistribute it and/or modify it
26+under the terms of the GNU General Public License as published by the
27+Free Software Foundation; either version 2 of the License, or (at your
28+option) any later version. See for
29+the full text of the license.
32+from apport.hookutils import *
33+import os
35+# Reference for this function:
36+def _my_files(report, filename, keyname):
37+ if not (os.path.exists(filename)):
38+ return
39+ key = keyname
40+ report[key] = ""
41+ for line in read_file(filename).split('\n'):
42+ try:
43+ if 'password' in line.split('"')[0]:
44+ line = "%s \"@@APPORTREPLACED@@\" " % (line.split('"')[0])
45+ report[key] += line + '\n'
46+ except IndexError:
47+ continue
49+def add_info(report):
50+ _my_files(report, os.path.expanduser('~/.mpdconf'), 'UserMpdConf')


People subscribed via source and target branches

to all changes: