Bug Hunting Session
Bug 39641 - Clean up document type association on Linux
Summary: Clean up document type association on Linux
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Marian Scerbak
URL:
Whiteboard:
Keywords: difficultyBeginner, easyHack, skillScript
Depends on:
Blocks:
 
Reported: 2011-07-28 10:07 UTC by Björn Michaelsen
Modified: 2017-02-14 08:57 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Michaelsen 2011-07-28 10:07:52 UTC
=== Clean up document type association on Linux ===

'''Background:''' [[http://en.wikipedia.org/wiki/MIME MIME-types]] are used to associate file types with applications. We need to clean up this stuff for the Linux build.

One challenge is to add missing information into ''build/desktop/openofficeorg.xml''. It is installed into ''/usr/share/mime/packages'' and tells the Linux system about new MIME-types. Many of them are already provided by the [[http://freedesktop.org/wiki/Software/shared-mime-info shared-mime-info]] package. It includes some nice improvements, e.g acronym, comment. We need to merge these improvements to the ''openoffice.xml'' file. Then we need to add missing information to the other MIME types that are still not covered by ''shared-mime-info''. Finally, we should report the new MIME types to the ''freedesktop bugzilla'', so they can be added to the ''shared-mime-info'' package. Note that ''openoffice.xml'' is useful for systems with old ''shared-mime-info''.

Second challenge is to update desktop files in ''libs-core/sysui/desktop/menus''. They associate the supported MIME types with LibreOffice. We need to make sure that the list of supported MIME types is in sync with ''openoffice.xml'' and ''shared-mime-info''. For example, ''shared-mime-info-0.90'' defines extra MIMEs for the flat file formats, .e.g ''application/vnd.oasis.opendocument.text-flat-xml''. It is supported by LO but not mentioned in ''writer.desktop''.

Last challenge is to review differences between ''libs-core/sysui/desktop/menus/*.desktop'' and ''build/deskop/*.desktop.in.in''. The later files were used by some Linux distributions. It does not make sense to have them any longer because we could update LO source code so easily. The thing is to do not lost any important information during the merge, specially the list of supported MIMEs.

'''Skills:''' reading, accuracy, patience
Comment 1 leighman 2012-02-13 03:44:06 UTC
Is this still something which needs doing?
Where does openofficeorg.xml live these days?
Comment 2 Dag Wieers 2012-02-13 04:00:11 UTC
I think so, at least in the RPM deployments we're missing the right associations for Flat XML ODF files (I think the mime-file was not being installed). On Windows they do seem to be present.
Comment 3 leighman 2012-02-28 08:31:27 UTC
I found that the file appears to be generated by the sysui/desktop/share/create_mime_xml.pl file. I tried to run it with perl create_mime_xml.pl but it didn't work. Any advice?
Comment 4 leighman 2012-02-28 10:11:45 UTC
Error I get is 'Cannot open "documents.ulf"'. documents.ulf is there
Comment 5 Florian Reisinger 2012-05-18 09:07:21 UTC
Deteted "Easyhack" from summary
Comment 6 Jelle van der Waa 2013-02-10 13:51:31 UTC
The perl script should be called  with the filename.
./create_mime_xml.pl documents.ulf

Works
Comment 7 Samuel Mehrbrodt (CIB) 2013-10-01 20:36:01 UTC
Seems the description is a bit outdated. The openoffice.xml exists no longer.

I made sure that all MIME types are covered by shared-mime-info. There were only two not covered which I reported in Bug 70016.

I found that in http://opengrok.libreoffice.org/xref/core/sysui/desktop/debian/postinst#47 and http://opengrok.libreoffice.org/xref/core/sysui/desktop/freedesktop/freedesktop-menus.spec#188 the /etc/mime.types and /etc/mailcap files are written. Can these be removed (I think the same information is provided by the file generated by create_mime_xml.pl)?

Another question: In sysui/desktop/mimetypes what is the purpose of the ".keys" files? And why is there a .desktop file for each MIME type?
Comment 8 retired 2013-10-02 07:34:53 UTC
Samuel, so does this mean, since we have Bug 70016, this one here can be closed?
Comment 9 Samuel Mehrbrodt (CIB) 2013-10-02 08:44:57 UTC
There needs to be some cleanup in the files I mentioned. Also the files in sysui/desktop/mimetypes/ need to be checked.

I'm waiting for a response to Comment 7 before I continue this cleanup.
Comment 10 Björn Michaelsen 2013-10-04 18:46:19 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 11 Robinson Tryon (qubit) 2015-12-14 06:50:38 UTC Comment hidden (obsolete)
Comment 12 Dhruv Khattar 2016-01-27 15:34:55 UTC
Can someone please help me understanding the issue?
What has to be done?
Comment 13 jani 2016-01-28 08:03:11 UTC
Hi

Look at comment 7-9.


I am here to help non-committers getting their first patch submitted.

if you have problems/questions please feel free to email me directly 
jani@documentfoundation.org

Of also using IRC and our mailing list is a good idea.

We have created a step by step guide, to help you over the first steps:
https://wiki.documentfoundation.org/Development/GetInvolved/DeveloperStepByStep

have fun
Comment 14 Robinson Tryon (qubit) 2016-02-18 14:52:08 UTC Comment hidden (obsolete)
Comment 15 Marian Scerbak 2016-05-01 00:19:47 UTC
Have three points regarding this bug:

1) can I pickup this topic? if so, 
2) think there is needed to change only files: 
http://opengrok.libreoffice.org/xref/core/sysui/desktop/debian/postinst#47 and http://opengrok.libreoffice.org/xref/core/sysui/desktop/freedesktop/freedesktop-menus.spec#188 to not generate files /etc/mime.types and /etc/mailcap
3) regarding sysui/desktop/mimetypes content:
- guess *.desktop files are needed there because user may want to use these files to launch libreoffice customized way for some mime types or so (https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html)
- my guess is also that the *.keys files are there for similar reason
Comment 16 jani 2016-05-01 10:26:30 UTC
(In reply to Marian Scerbak from comment #15)
> Have three points regarding this bug:
> 
> 1) can I pickup this topic? if so, 
> 2) think there is needed to change only files: 
> http://opengrok.libreoffice.org/xref/core/sysui/desktop/debian/postinst#47
> and
> http://opengrok.libreoffice.org/xref/core/sysui/desktop/freedesktop/
> freedesktop-menus.spec#188 to not generate files /etc/mime.types and
> /etc/mailcap
> 3) regarding sysui/desktop/mimetypes content:
> - guess *.desktop files are needed there because user may want to use these
> files to launch libreoffice customized way for some mime types or so
> (https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-
> spec-latest.html)
> - my guess is also that the *.keys files are there for similar reason

Of course you can, just assign it to yourself, so other know you are working on it.

2) sounds correct
3) guessing is good, control is better, and if so then maybe add a comment in the file, about the content.
Comment 17 Samuel Mehrbrodt (CIB) 2016-05-10 19:05:14 UTC
Closing this bug as some work already has been done and it is not very clear what is missing.

So if there is something still to be done here, please create a new easy hack with clear steps what is to be done.