Merge lp:~takluyver/ubuntu/raring/apt-xapian-index/catch-invalid-desktop-files into lp:ubuntu/raring/apt-xapian-index

Proposed by Thomas Kluyver
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: not available
Proposed branch: lp:~takluyver/ubuntu/raring/apt-xapian-index/catch-invalid-desktop-files
Merge into: lp:ubuntu/raring/apt-xapian-index
Diff against target: 57 lines (+37/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/04_catch_invalid_desktop_file.patch (+29/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~takluyver/ubuntu/raring/apt-xapian-index/catch-invalid-desktop-files
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Ubuntu branches Pending
Review via email: mp+135736@code.launchpad.net

Description of the change

An invalid app-install desktop entry file (see bug #1080669) was causing update-apt-xapian-index to fail. Previous versions of PyXDG had unintentionally masked the error. This catches the exception, and ignores the invalid .desktop file.

To post a comment you must log in.
Revision history for this message
Thomas Kluyver (takluyver) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your work, the buggy .desktop got fixed in raring meanwhile, it would still be good to get the patch included but could you update the merge request to include a changelog entry and a patch in debian/patches rather than a direct patch to the source?

review: Needs Fixing
34. By Thomas Kluyver

Catch error from invalid parsing file - move change to patch

Revision history for this message
Thomas Kluyver (takluyver) wrote :

Thanks, Sebastien. I've done as you suggest.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, uploading to raring

review: Approve
Revision history for this message
Thomas Kluyver (takluyver) wrote :

Is it possible to deliver this as an SRU for Quantal as well? It's a pretty nasty regression that I keep getting 'System problem detected' notifications when update-apt-xapian-index runs.

Revision history for this message
Sebastien Bacher (seb128) wrote :

what do you mean? quantal doesn't have the pyxdg version that expose the issue...

Revision history for this message
Thomas Kluyver (takluyver) wrote :

Oops, you're right. I'd installed a newer version of python-xdg while working on packaging it. That's a relief - it's only myself and some very early upgraders that I caused problems for ;-)

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-10-31 10:24:35 +0000
3+++ debian/changelog 2012-11-27 17:40:25 +0000
4@@ -1,3 +1,10 @@
5+apt-xapian-index (0.44ubuntu9) UNRELEASED; urgency=low
6+
7+ * debian/patches/04_catch_invalid_desktop_file.patch: Catch an exception
8+ from parsing invalid .desktop files for app-install.
9+
10+ -- Thomas Kluyver <thomas@kluyver.me.uk> Tue, 27 Nov 2012 17:06:09 +0000
11+
12 apt-xapian-index (0.44ubuntu8) raring; urgency=low
13
14 * debian/patches/03_policykit_translations.patch: remove underscores from
15
16=== added file 'debian/patches/04_catch_invalid_desktop_file.patch'
17--- debian/patches/04_catch_invalid_desktop_file.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/04_catch_invalid_desktop_file.patch 2012-11-27 17:40:25 +0000
19@@ -0,0 +1,29 @@
20+PyXDG <= 0.19 had inadvertantly masked this error.
21+
22+Patch forwarded upstream.
23+
24+=== modified file 'plugins/app-install.py'
25+--- old/plugins/app-install.py 2011-07-26 09:02:49 +0000
26++++ new/plugins/app-install.py 2012-11-22 16:42:14 +0000
27+@@ -1,5 +1,6 @@
28+ try:
29+ from xdg.DesktopEntry import DesktopEntry
30++ from xdg.Exceptions import ParsingError
31+ from xdg import Locale
32+ HAS_XDG=True
33+ except ImportError, e:
34+@@ -142,7 +143,12 @@
35+ progress.begin("Reading .desktop files from %s" % APPINSTALLDIR)
36+ for f in os.listdir(APPINSTALLDIR):
37+ if f[0] == '.' or not f.endswith(".desktop"): continue
38+- entry = DesktopEntry(os.path.join(APPINSTALLDIR, f))
39++ try:
40++ entry = DesktopEntry(os.path.join(APPINSTALLDIR, f))
41++ except (ValueError, ParsingError):
42++ # Invalid .desktop files can cause a ValueError. From PyXDG 0.25,
43++ # that case will be turned into a ParsingError.
44++ continue
45+ pkg = entry.get("X-AppInstall-Package")
46+ self.entries.setdefault(pkg, []).append((f, entry))
47+ progress.end()
48+
49
50=== modified file 'debian/patches/series'
51--- debian/patches/series 2012-10-31 10:24:35 +0000
52+++ debian/patches/series 2012-11-27 17:40:25 +0000
53@@ -1,3 +1,4 @@
54 01_axi_cjk_support.patch
55 02_axi-pkgname-mangled-term.patch
56 03_policykit_translations.patch
57+04_catch_invalid_desktop_file.patch

Subscribers

People subscribed via source and target branches