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

Proposed by Ronny Cardona
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 (community) Approve
Ubuntu branches 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.
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
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?

Revision history for this message
Ronny Cardona (rcart) wrote :

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

Revision history for this message
Daniel Holbach (dholbach) wrote :

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

Revision history for this message
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?

Revision history for this message
Daniel Holbach (dholbach) wrote :

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

Revision history for this message
Ronny Cardona (rcart) wrote :

Oh, great. Thanks for clarify.

Revision history for this message
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
Revision history for this message
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
=== modified file 'debian/changelog'
--- debian/changelog 2012-03-04 00:11:01 +0000
+++ debian/changelog 2012-03-16 17:20:23 +0000
@@ -1,3 +1,10 @@
1mpd (0.16.5-1ubuntu4) precise; urgency=low
2
3 * debian/source_mpd.py
4 - Added apport hook to include user configuration file. (LP: #947551)
5
6 -- Ronny Cardona <rcart19@gmail.com> Wed, 07 Mar 2012 18:03:12 -0600
7
1mpd (0.16.5-1ubuntu3) precise; urgency=low8mpd (0.16.5-1ubuntu3) precise; urgency=low
29
3 * debian/mpd.init.d:10 * debian/mpd.init.d:
411
=== added file 'debian/source_mpd.py'
--- debian/source_mpd.py 1970-01-01 00:00:00 +0000
+++ debian/source_mpd.py 2012-03-16 17:20:23 +0000
@@ -0,0 +1,31 @@
1'''
2apport package hook for Music Player Deamon
3
4Author: Ronny Cardona <rcart19@gmail.com>
5
6This program is free software; you can redistribute it and/or modify it
7under the terms of the GNU General Public License as published by the
8Free Software Foundation; either version 2 of the License, or (at your
9option) any later version. See http://www.gnu.org/copyleft/gpl.html for
10the full text of the license.
11'''
12
13from apport.hookutils import *
14import os
15
16# Reference for this function: http://pastebin.ubuntu.com/263396/
17def _my_files(report, filename, keyname):
18 if not (os.path.exists(filename)):
19 return
20 key = keyname
21 report[key] = ""
22 for line in read_file(filename).split('\n'):
23 try:
24 if 'password' in line.split('"')[0]:
25 line = "%s \"@@APPORTREPLACED@@\" " % (line.split('"')[0])
26 report[key] += line + '\n'
27 except IndexError:
28 continue
29
30def add_info(report):
31 _my_files(report, os.path.expanduser('~/.mpdconf'), 'UserMpdConf')

Subscribers

People subscribed via source and target branches

to all changes: