Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<recommends> tag support #471

Open
sidt4 opened this issue Jul 22, 2023 · 7 comments
Open

<recommends> tag support #471

sidt4 opened this issue Jul 22, 2023 · 7 comments

Comments

@sidt4
Copy link

sidt4 commented Jul 22, 2023

<recommends> tag is currently not supported / implemented in appstream-util

$ appstream-util validate-strict --nonet /usr/share/metainfo/org.gnome.Nautilus.appdata.xml 
/usr/share/metainfo/org.gnome.Nautilus.appdata.xml: FAILED:
• value-missing         : <!-- Copyright [year] [name] --> is not present
• tag-invalid           : XML data contains unknown tag
• tag-missing           : <content_rating> required [use https://odrs.gnome.org/oars]
• style-invalid         : <caption> is too short [Grid View];shortest allowed is 10 chars
• style-invalid         : <caption> is too short [List View];shortest allowed is 10 chars
• style-invalid         : <caption> is too short [Search];shortest allowed is 10 chars
Validation of files failed

The invalid tag name is missing in above log. With #470, the invalid tag name is now displayed.

$ appstream-util validate-strict --nonet /usr/share/metainfo/org.gnome.Nautilus.appdata.xml 
/usr/share/metainfo/org.gnome.Nautilus.appdata.xml: FAILED:

(appstream-util:292180): As-WARNING **: 14:24:14.636: Unknown tag: <recommends>
• value-missing         : <!-- Copyright [year] [name] --> is not present
• tag-invalid           : XML data contains unknown tag
• tag-missing           : <content_rating> required [use https://odrs.gnome.org/oars]
• style-invalid         : <caption> is too short [Grid View];shortest allowed is 10 chars
• style-invalid         : <caption> is too short [List View];shortest allowed is 10 chars
• style-invalid         : <caption> is too short [Search];shortest allowed is 10 chars
Validation of files failed

It appears that <recommends> tag is used by lot of apps, as below:

$ grep "<recommends>" -Ri /usr/share/metainfo/
/usr/share/metainfo/org.gnome.Maps.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.Nautilus.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.seahorse.Application.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.Software.metainfo.xml:  <recommends>
/usr/share/metainfo/org.gnome.DiskUtility.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.Console.metainfo.xml:  <recommends>
/usr/share/metainfo/org.gnome.Terminal.metainfo.xml:  <recommends>
/usr/share/metainfo/org.gnome.Contacts.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.DejaDup.metainfo.xml:  <recommends>
/usr/share/metainfo/org.gnome.Sudoku.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.Polari.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.Calculator.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.Chess.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.Hitori.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.Characters.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.Extensions.metainfo.xml:  <recommends>
/usr/share/metainfo/org.gnome.Epiphany.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.clocks.metainfo.xml:  <recommends>
/usr/share/metainfo/org.inkscape.Inkscape.appdata.xml:  <recommends>
/usr/share/metainfo/org.gnome.Geary.appdata.xml:  <recommends>
@sidt4
Copy link
Author

sidt4 commented Jul 22, 2023

Just FYI.

  1. /usr/share/metainfo/org.gnome.DejaDup.metainfo.xml

    (appstream-util:295440): As-WARNING **: 14:32:40.574: Unknown tag: <branding>

  2. /usr/share/metainfo/org.inkscape.Inkscape.appdata.xml:

    (appstream-util:295789): As-WARNING **: 14:32:42.416: Unknown tag: <supports>

@hughsie
Copy link
Owner

hughsie commented Jul 24, 2023

I think using appstreamcli is probably a much better idea - it's much more up to date that the validator here.

@sidt4
Copy link
Author

sidt4 commented Jul 25, 2023

Yes, it seems like appstreamcli is better. But, then why keep the validator ? It's confusing.

@ximion
Copy link
Collaborator

ximion commented Jul 25, 2023

For a while there was still tools using appstream-glib - nowadays we could probably remove it from Linux distributions, but then again, if someone needs it to reproduce previous behavior or wants to compile older code it is available and nice to have.
For newer things, just use appstreamcli :)

@sidt4
Copy link
Author

sidt4 commented Jul 25, 2023

Can we at least print a warning when using appstream-glib saying "appstreamcli should be used etc." ?

Point here is that, it sounds good for those who are aware of appstream-glib and appstreamcli. But based on the information available in web ( some articles point to appstream-glib and some appstreamcli ), new users could still start their appstream journey with appstream-glib, thinking they are using the new tools.

I have wasted few clocks on this. Don't want others to go through the same.

@hughsie
Copy link
Owner

hughsie commented Jul 27, 2023

Can we at least print a warning when using appstream-glib saying "appstreamcli should be used etc." ?

I'm worried about that breaking automated scripts --- but maybe that's something we should do anyway :)

The alternative is to just run appstreamcli if the user types in appstream-util validate. @ximion any concerns about this?

@ximion
Copy link
Collaborator

ximion commented Jul 27, 2023

The alternative is to just run appstreamcli if the user types in appstream-util validate. @ximion any concerns about this?

The two tools are not quite 100% compatible - wouldn't that break scripts even more? It would also make appstream-glib and appstreamcli not coinstallable (although that's probably not an issue at this point).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants