Created attachment 45098 [details] validate.c: do not require all possible main categories to be present According to standard, "The Related Categories column lists one or more categories that are suggested to be used in conjunction with the Additional Category. Note that at least one Main Category must be included ...". But there are many categories where desktop-file-validate requires all possible Main Categories to be present. (see attached patch or git commit (link below) for the list of affected categories. The standart allows multiple Main Categories, but clearly specifies that it is optional: "__If__ multiple Main Categories are included ..." like, Education;Music; is clearly different from AudioVideo;Music; and both forms should be allowed because they go to the different menus. Example: warn sylpheed-3.1.0-alt1.x86_64 desktop-file-validate utility exited abnormally with the following message(s): /usr/share/applications/sylpheed.desktop: error: (will be fatal in the future): value "Email" in key "Categories" in group "Desktop Entry" requires another category to be present among the following categories: Office;Network; whereas sylpheed's Categories=GTK;Network;Email;News; and many more. proposed patch is attached and also can be merged from http://git.altlinux.org/people/viy/packages/?p=desktop-file-utils-xdg.git;a=commit;h=9e35a53b52aeba3e709fec16cfc3a52eb5f2bce7
Created attachment 46910 [details] [review] second version (w/o Science) First patch contained a bug about Science (Science is not a main Category) so the proposed path is now for "Email", "Music", and "ProjectManagement" only.
Created attachment 46914 [details] [review] TextTools; should require either Office; or Utility;. on a related note, "Dictionary" requires TextTools;Office; but not TextTools;Utility. but TextTools; requires Utility. to resolve this, TextTools; should require either Office; or Utility;.
Comment on attachment 46910 [details] [review] second version (w/o Science) Review of attachment 46910 [details] [review]: ----------------------------------------------------------------- My understanding of the related categories in the spec is that "Office;TextTools" is different from "Office or TextTools". That's why it's implemented this way. Now, the spec might be using ";" where "or" should be used, and we should fix that first. The Music example is a good one where it sounds wrong.
(In reply to comment #2) > Created attachment 46914 [details] [review] [review] > TextTools; should require either Office; or Utility;. > > on a related note, "Dictionary" requires TextTools;Office; > but not TextTools;Utility. > > but TextTools; requires Utility. > to resolve this, TextTools; should require either Office; or Utility;. Let's fix the spec first :-)
(In reply to comment #4) > Let's fix the spec first :-) Completely agree. Yet I'm a novice here at freedesktop.org, I do not know where to ask about the spec changes :( Could you give me some directions?
Another example where desktop-file-validate outputs a false positive is the desktop entry of GNU Emacs 24.1 which has "Development;TextEditor;" as categories. $ desktop-file-validate emacs.desktop emacs.desktop: error: (will be fatal in the future): value "TextEditor" in key "Categories" in group "Desktop Entry" requires another category to be present among the following categories: Utility The description of "Utility" is "Small utility application, 'Accessories'" which doesn't look right for Emacs. The spec actuall says: "The Related Categories column lists one or more categories that are *suggested* to be used in conjunction with the Additional Category." Suggested doesn't mean required.
What's required to get this moving? Happy to help.
(In reply to comment #6) > The spec actuall says: "The Related Categories column lists one or more > categories that are *suggested* to be used in conjunction with the Additional > Category." Suggested doesn't mean required. Yes, that's something we fixed recently in the spec, and that we need to handle in desktop-file-utils. I think we'll still have a warning if a main category is not present, as there's no guarantee the desktop file will appear where it should in the menus. A warning is no error, so I guess that'd be fine.
Created attachment 67042 [details] [review] no-main-category.patch Here's a small patch that drops "does not contain a registered main category" errors, as per the updated spec.
Created attachment 67044 [details] [review] no-main-category.patch Updated patch to turn lack of main category into a warning, wrt comment #8.
Created attachment 67054 [details] [review] related-categories.patch This additional patch drops related category validation (since they are now optional), while retaining validation of "Category1;Category2" (compare with "Category1 or Category 2).
Thanks for your patches, Michael. I've pushed some that are similar, but a bit different: - for the first one, we output a hint instead of a warning (hints are new, so nothing you could do) - for the second one, there are actually still cases where a category requires another (Audio requires AudioVideo). So this had to work another way; I added some hint for the related categories, also. Keeping the bug open for the initial comment (see my comment 3).
(In reply to comment #12) > Keeping the bug open for the initial comment (see my comment 3). Patch for the spec posted: http://lists.freedesktop.org/archives/xdg/2012-October/012526.html
Spec change pushed, and fixed to desktop-file-utils pushed too.
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.