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

Subscribers

People subscribed via source and target branches