Summary: | app-text/calibre installs wrong file type/MIME associations | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Janek Bevendorff <bevendorffjanek> |
Component: | [OLD] Unspecified | Assignee: | Zac Medico <zmedico> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mantas, rogerx.oss |
Priority: | Normal | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | http://forums.gentoo.org/viewtopic-p-6605711.html | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Janek Bevendorff
2011-03-09 13:30:04 UTC
Thanks, I've updated the calibre-0.7.48 ebuild to remove those mime types: --- calibre-0.7.48.ebuild +++ calibre-0.7.48.ebuild @@ -159,6 +159,14 @@ dodir /usr/share/icons mv "$HOME"/.local/share/icons/* "$D"usr/share/icons/ || die "failed to install icon files" + + # Bug #358065 - Remove inappropriate mime types from *.desktop. + sed -e "s:application/octet-stream;::g" \ + -e "s:text/html;::g" \ + -e "s:text/plain;::g" \ + -i "$HOME"/.local/share/applications/*.desktop \ + || die "sed failed" + domenu "$HOME"/.local/share/applications/*.desktop || die "failed to install .desktop menu files" (In reply to comment #1) > Thanks, I've updated the calibre-0.7.48 ebuild to remove those mime types: > > --- calibre-0.7.48.ebuild > +++ calibre-0.7.48.ebuild > @@ -159,6 +159,14 @@ > dodir /usr/share/icons > mv "$HOME"/.local/share/icons/* "$D"usr/share/icons/ || > die "failed to install icon files" > + > + # Bug #358065 - Remove inappropriate mime types from *.desktop. > + sed -e "s:application/octet-stream;::g" \ > + -e "s:text/html;::g" \ > + -e "s:text/plain;::g" \ > + -i "$HOME"/.local/share/applications/*.desktop \ > + || die "sed failed" > + > domenu "$HOME"/.local/share/applications/*.desktop || > die "failed to install .desktop menu files" You ought to add text/rtf, application/pdf and application/xhtml+xml to that list as well then it should be fine. And application/vnd.oasis.opendocument.text which is the open document format (used by OpenOffice/LibreOffice, file extension: .odt). Thanks, those are added now too. This is the wrong fix for this issue. Since calibre handles PDF, RTF, TXT, ODT filetypes removing them from the .desktop files is broken. A desktop file is supposed to list all mimetypes that the application can handle. See http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s07.html You need to patch xdg-utils on Gentoo to not adjust the default mimetype handlers when installing .desktop files instead. (In reply to comment #5) > This is the wrong fix for this issue. Since calibre handles PDF, RTF, TXT, ODT > filetypes removing them from the .desktop files is broken. A desktop file is > supposed to list all mimetypes that the application can handle. See > http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s07.html > > You need to patch xdg-utils on Gentoo to not adjust the default mimetype > handlers when installing .desktop files instead. @freedesktop-bugs: If you guys are thinking about patching xdg-utils as suggested here, then please leave us a comment. Thanks! we don't need to do that, DEs should provide a defaults.list (see gnome-session ebuild for example) if they have a preferred list of applications. xdg-utils just generates a cache and I'm pretty sure it doesn't have a default mechanism itself, it just takes the first entry corresponding the to mime in the cache. Thanks for the explanation. I'll go ahead and remove you from CC now. I plan to fix the ebuild so that it doesn't filter so many mime types from the desktop files. We shouldn't need to filter anything that is likely to have a sane default defined by the DE, or anything for which it would not be insane to have calibre listed as the sole provider in /usr/share/applications/mimeinfo.cache. I suspect that the main reason for this bug report is that one or more of calibre's desktop files used to list application/octet-stream in the MimeType field, which was somewhat insane to have listed as the sole provider in mimeinfo.cache, given that many DEs may not have a default handler for such a generic mimetype. Looking at the latest calibre desktop files, application/octet-stream is no longer listed in any of the MimeType fields. So, perhaps there's no longer any need to filter anything. *** Bug 384289 has been marked as a duplicate of this bug. *** Just my two cents, I absolutely hate something taking over my personal document and piping it to something else without first asking me. (See duplicate closed bug #384289) And, even if it did ask, I'd still say no. ;-) (Thanks Zac for notifying me of this!) |