Bug 235 - .deb files are sniffed as .ar files
Summary: .deb files are sniffed as .ar files
Status: RESOLVED FIXED
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: freedesktop.org.xml (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Jonathan Blandford
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-27 01:25 UTC by Ross Burton
Modified: 2004-03-18 11:44 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Append instead of prepend new matchlets (738 bytes, patch)
2004-03-02 12:09 UTC, Ross Burton
Details | Splinter Review
lower application/x-archive priority (642 bytes, patch)
2004-03-08 04:31 UTC, Christophe Fergeau
Details | Splinter Review

Description Ross Burton 2004-02-27 01:25:05 UTC
When Nautilus first views a directory, it shows mime types based on quick
filename matching, so my .deb (Debian packages) files have the correct MIME
type/icons.  However, when I click on a file Nautilus will sniff, and the mime
type changes to application/x-archive.

This has broken my Nautilus .deb property pages :(
Comment 1 Ross Burton 2004-02-27 07:33:43 UTC
I've been poking at this, and think its actually a bug in xdgmimemagic.c.
Comment 2 Ross Burton 2004-03-02 12:08:11 UTC
Attaching a very rough patch which fixes this problem for me.  Basically new
matchlets were being prepended to the list instead of being appended. This
results in a matchlet chain which starts with a high indent and drops, instead
of the other way around.

This then breaks when searching as the indent of the matchlet chain does not
start with 0.

Note that this also fixes the bug where ELF executables are sniffed as core dumps.
Comment 3 Ross Burton 2004-03-02 12:09:28 UTC
Created attachment 117 [details] [review]
Append instead of prepend new matchlets

Incredibly ugly, but it works and I have dinner to eat.
Comment 4 Christophe Fergeau 2004-03-08 04:03:46 UTC
This really belongs to the xdgmime component. This is supposed to be fixed by
the patch in bug #264, but some quick test shows it is not :-/ As expected, I
screwed up the patch somehow ;)
Comment 5 Christophe Fergeau 2004-03-08 04:25:28 UTC
I investigated a bit more, and my patch is actually working fine. The problem is
that application/x-archive and application/x-deb have the same priority, and
application/x-archive comes first in the xml file. Lowering
application/x-archive priority/raising application/x-deb priority nicely fixes
the problem (when my patch is applied to xdgmime).
Comment 6 Ross Burton 2004-03-08 04:30:11 UTC
Confirmed, I must lost my local change to push the priority to 60 at some point
in the past.
Comment 7 Christophe Fergeau 2004-03-08 04:31:43 UTC
Created attachment 132 [details] [review]
lower application/x-archive priority
Comment 8 Johan Fischer 2004-03-10 00:28:23 UTC
yep, it works for me. Thx :)
Comment 9 Ross Burton 2004-03-19 06:44:15 UTC
Alex just committed this, closing.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.