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/source_mpd.py (+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: mp+96496@code.launchpad.net

Description of the change

* debian/source_mpd.py
  - 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 https://wiki.archlinux.org/index.php/Music_Player_Daemon 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 (source_mpd.py) 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/source_mpd.py 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
6+
7+ * debian/source_mpd.py
8+ - Added apport hook to include user configuration file. (LP: #947551)
9+
10+ -- Ronny Cardona <rcart19@gmail.com> Wed, 07 Mar 2012 18:03:12 -0600
11+
12 mpd (0.16.5-1ubuntu3) precise; urgency=low
13
14 * debian/mpd.init.d:
15
16=== added file 'debian/source_mpd.py'
17--- debian/source_mpd.py 1970-01-01 00:00:00 +0000
18+++ debian/source_mpd.py 2012-03-16 17:20:23 +0000
19@@ -0,0 +1,31 @@
20+'''
21+apport package hook for Music Player Deamon
22+
23+Author: Ronny Cardona <rcart19@gmail.com>
24+
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 http://www.gnu.org/copyleft/gpl.html for
29+the full text of the license.
30+'''
31+
32+from apport.hookutils import *
33+import os
34+
35+# Reference for this function: http://pastebin.ubuntu.com/263396/
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
48+
49+def add_info(report):
50+ _my_files(report, os.path.expanduser('~/.mpdconf'), 'UserMpdConf')

Subscribers

People subscribed via source and target branches

to all changes: