fix globbing issue where first mimetype is ignored for later matches

This commit is contained in:
Tom Callaway 2013-03-05 10:23:09 -05:00
parent e89f0bf41e
commit 08e69739fa
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,13 @@
diff -up pyxdg-0.25/xdg/Mime.py.BAD pyxdg-0.25/xdg/Mime.py
--- pyxdg-0.25/xdg/Mime.py.BAD 2013-03-05 10:19:10.750845664 -0500
+++ pyxdg-0.25/xdg/Mime.py 2013-03-05 10:19:14.771845520 -0500
@@ -360,7 +360,8 @@ def _cache_database():
if pattern.startswith('*.'):
rest = pattern[2:]
if not ('*' in rest or '[' in rest or '?' in rest):
- exts[rest] = mtype
+ if rest not in exts:
+ exts[rest] = mtype
continue
if '*' in pattern or '[' in pattern or '?' in pattern:
globs.append((pattern, mtype))

View File

@ -12,6 +12,8 @@ Group: Development/Libraries
License: LGPLv2
URL: http://freedesktop.org/Software/pyxdg
Source0: http://people.freedesktop.org/~takluyver/%{name}-%{version}.tar.gz
# https://bugs.freedesktop.org/show_bug.cgi?id=61817
Patch0: pyxdg-0.25-find-first-mimetype-match.patch
BuildArch: noarch
# These are needed for the nose tests.
BuildRequires: python-nose, hicolor-icon-theme
@ -35,6 +37,7 @@ package contains a Python 3 version of PyXDG.
%prep
%setup -q
%patch0 -p1 -b .pngfix
%if 0%{?with_python3}
rm -rf %{py3dir}