I'm remerging major parts of my KDE 3.5.7 ebuilds due to changed USE flags. I got lots of mails from elog warning about invalid desktop entries. Traced this to validate_desktop_entries in eutils.eclass which calls desktop-file-validate from dev-util/desktop-file-utils if available.
To reproduce the error messages for installed entries, this seems to work:
for i in /usr/kde/3.5/share/applications/kde/*.desktop; do
done | grep error
Typical examples, in order of decreasing frequency:
* value "..." for string list key "MimeType" in group "Desktop Entry"
does not have a semicolon (';') as trailing character
* value "..." for key "Categories" in group "Desktop Entry"
contains an unregistered value "..."
* file contains key "..." in group "Desktop Entry",
but keys extending the format should start with "X-"
In case you have trouble reproducing this, I can give you the complete messages from my elog mails or the complete output from the loop described above.
I have kde-base/kde-meta-3.5.7 and dev-util/desktop-file-utils-0.13
Maybe the check errors (perhaps even warnings) should be QA warnings, not simple ewarn messages which will be logged for most users though I guess most are unlikely to do anything about them.
As you made this a Tracker and have sub-bugs for individual ebuilds, I matched the errors I can find on my system to the corresponding ebuilds. Do you want to open a bug report for each of these? Or only packages outside kde-base?
kde-base/kate-3.5.7-r1 (kate.desktop, kwrite.desktop)
kde-base/kcontrol-3.5.7-r1 (installktheme.desktop, kfontview.desktop)
kde-base/keduca-3.5.7 (keducabuilder.desktop, keduca.desktop)
kde-base/konqueror-3.5.7-r2 (kfmclient_dir.desktop, kfmclient_war.desktop)
Martin, please only file individual bugs for packages outside of kde-base.
Created attachment 129050 [details]
desktop validation errors for 61 packages
Now I ran this command on my system:
locate \*.desktop | grep -vE '^/usr/portage|^/usr/local' | while read i; do
done | grep error | cut -d: -f1 | qfile -v -f - | cut -d\ -f1 | sort -u
to find out which other desktop files on my system are broken. I found KOffice, for which I filed bug 190006, and 61 more packages outside kde-base. I don't know which of these ebuilds run validate_desktop_entries, but whether or not, a bad desktop entry is a bad thing in any case, right?
Right now I don't have the time to file 61 bug reports, especially since I can't specify a block with the initial submission, so I'd have to edit each report twice. Also I wouldn't consider my system representative, so perhaps the above command could be run on one of the tinderboxes or some other host with a large collection of built packages?
I'm attaching the list of errors, in case someone is curious or willing to file a bunch of bugs for them, maybe using some bulk submission tool.
Thanks, Martin! Not filing individual bugs for all these is better anyway. I simply didn't expect that many. We'll look at your list instead.
Do you plan to provide some desktop entry fixing function in some eclass?
In this case it would be nice to let Thomas A. know about it, as he's preparing fixes to individual ebuilds in bug 190006.
Missing semicolon can be fixed easily, and forbidden keys kan be removed or prefixed with X-. To fix the Categories, the ebuild must probably provide the correct category, but the actual text replacement can be in some eclass as well. The same goes for missing names. Incorrect UTF-8 format can be handled by finding these sequences, assuming they are ISO-8859-1, and recoding them. This Version business I haven't understood yet, will probably have to read the sources of the checker or some desktop file format spec.
I guess I would want an eclass for desktop entry mangling, inherited by kde eclass and some individual ebuilds. I would want a separate function for each fix, such that the ebuild still has to say what's wrong, but in a readable way, so that you know what it is fixing, not so much how it is fixing it. You still could have some auto-fix function calling the individual ones if absolutely needed. In this case that function should probably be versioned somehow, so that you can write one with different corrections in the future without modifying the behavior of current ebuilds.
Created attachment 192506 [details]
KDE 3.5 is going away soon, this won't be fixed