Bug 201498 - make repoman run desktop-file-validate on .desktop files
Bug#: 201498 Product:  Portage Development Version: 2.2 Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: dev-portage@gentoo.org Reported By: betelgeuse@gentoo.org
Component: Repoman
URL:  http://dev.gentoo.org/~betelgeuse/desktop-files/baddesktop
Summary: make repoman run desktop-file-validate on .desktop files
Keywords:  InSVN
Status Whiteboard: 
Opened: 2007-12-06 17:51 0000
Description:   Opened: 2007-12-06 17:51 0000
We have lots of .desktop files in files/ so we should make repoman run
desktop-file-validate on them if it's installed. Perhaps add a qa use flag to
pull it in. Here are the current results:
http://dev.gentoo.org/~betelgeuse/desktop-files/results.txt
The script used to create these:
http://dev.gentoo.org/~betelgeuse/desktop-files/baddesktop

------- Comment #1 From Zac Medico 2007-12-06 18:04:42 0000 -------
Is there any significant benefit to distributing a pre-generated .desktop file
vs. generating one on-the-fly using make_desktop_entry from eutils.eclass? If
not, perhaps we should just have repoman complain about any .desktop files in
${FILESDIR}.

If there's something that makes make_desktop_entry() insufficient in lots of
cases, maybe we can fix those shortcomings.

------- Comment #2 From Petteri Räty 2007-12-06 18:14:52 0000 -------
(In reply to comment #1)
> Is there any significant benefit to distributing a pre-generated .desktop file
> vs. generating one on-the-fly using make_desktop_entry from eutils.eclass? If
> not, perhaps we should just have repoman complain about any .desktop files in
> ${FILESDIR}.
> 

At least translations come to mind.

------- Comment #3 From Ulrich Müller 2007-12-07 00:33:47 0000 -------
Apart from translations, "make_desktop_entry" supports only a small subset of
the desktop entry keys mentioned in
<http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html>.

My personal statistics is not very large, but in 3 of 3 cases I couldn't use
make_desktop_entry because it was not flexible enough:
- no support for a "Comment" different from $DESCRIPTION (needed because the
  ebuild installs two desktop files),
- no support for "MimeType", "NoDisplay", and "Terminal" keys.

Also, in case of "Exec" being anything other than a simple command (i.e. if it
is a full path or has arguments), the generated file has a strange name. For
example, "_usr_bin_emacsclient_-a__usr_bin_emacs_%F-emacs-desktop.desktop".

(In reply to comment #1)
> [...] perhaps we should just have repoman complain about any .desktop files
> in {FILESDIR}.

IMHO, that's not a good idea.

------- Comment #4 From SpanKY 2007-12-07 06:44:49 0000 -------
then why dont you extend the desktop creation function

------- Comment #5 From Santiago M. Mola 2007-12-10 19:34:45 0000 -------
make_desktop_entry (or a new function) could take as an argument the shipped
.desktop, fix some fields and add the ones which are missing. It could also
print an ewarn when it find an invalid category.

------- Comment #6 From Petteri Räty 2007-12-23 02:46:19 0000 -------
(In reply to comment #5)
> make_desktop_entry (or a new function) could take as an argument the shipped
> .desktop, fix some fields and add the ones which are missing. It could also
> print an ewarn when it find an invalid category.
> 

We already have domenu.

------- Comment #7 From Santiago M. Mola 2007-12-25 14:36:42 0000 -------
(In reply to comment #6)
> (In reply to comment #5)
> > make_desktop_entry (or a new function) could take as an argument the shipped
> > .desktop, fix some fields and add the ones which are missing. It could also
> > print an ewarn when it find an invalid category.
> > 
> 
> We already have domenu.
> 

Fixing some fields, adding new ones or print warnings is still applicable to
domenu.

------- Comment #8 From Zac Medico 2007-12-30 17:31:01 0000 -------
This has been released in 2.1.4_rc12.