#437 add to packaging:guidelines section 'AppStream files'
Closed: Fixed None Opened 6 years ago by ignatenkobrain.

Richard Hughes wrote appstream-util (libappstream-glib), which available since f21 (now rawhide).

Now many packages in Fedora shipping appdata.xml. 63 for rawhide.
Today he's posted about new feature of appstream things[1].
We filled bugs about adding metadata.xml to gedit, claws-mail, eclipse plugins, evolution-rss.
I will implement metadata.xml for gedit-plugins, claws-mail and already implemented (but not pushed to git) for evolution-rss.

I think we should require maintainers if package ship appdata.xml or metainfo.xml to use appstream-util validate in %check section. In wiki should be near .desktop files section.

How it works?
$ appstream-util validate /usr/share/appdata/evolution.appdata.xml
File validated successfully!
$ echo $?
0
$ appstream-util validate /usr/share/appdata/0ad.appdata.xml
attribute-invalid <screenshot> width was too large
attribute-invalid <screenshot> height was too large
Validation failed
$ echo $?
1

I think we should not allow if appstream-util validate will fail.
For appdata.xml:
{{{
appstream-util validate %{buildroot}%{_datadir}/appdata/something_name.appdata.xml || :
}}}
For metadata.xml (not yet available. hughsie said that he will release new version which support it at this weekend)
{{{
appstream-util validate %{buildroot}%{_datadir}/appdata/something_name.metadata.xml || :
}}}

[0]https://lists.fedoraproject.org/pipermail/devel/2013-September/188799.html
[1]https://lists.fedoraproject.org/pipermail/devel/2014-June/199901.html


bad formatting in top post.
{{{
$ appstream-util validate /usr/share/appdata/evolution.appdata.xml
File validated successfully!
$ echo $?
0

$ appstream-util validate /usr/share/appdata/0ad.appdata.xml
attribute-invalid <screenshot> width was too large
attribute-invalid <screenshot> height was too large Validation failed
$ echo $?
1
}}}

I've just built libappstream-glib-0.1.7-1.fc21 into rawhide and f20 -- this can validate multiple appdata/metainfo files. There is a way of making the rules a little less strict -- just use 'appstream-util validate-relax /usr/share/appdata/' -- this makes more appdata files pass, at the cost of applications looking slightly odd in the software center. We don't want people removing* the appdata file just because it doesn't validate against our semi-strict style guide.

The Appdata guidelines are nearing completion: https://fedorahosted.org/fpc/ticket/414

Please write up a draft that's either a patch to that or a new subsection of it. We'd like a brief explanation of the relationship between the two formats in the draft and probably an example similar to what's included for appdata files if package maintainers might have to add these files (it seems like that would be the case just like for appdata).

Making a Guideline that's a '''MUST''' for this but then making it so a failure won't block the build will have an overall Null effect (maintainers won't notice failures unless it fails the build so why require them to add it in the first place?) We likely want this to either be a SHOULD or to fail the build. Note that other cases of validating a file (desktop-file-validate and app-data-validate) fail the build so that might be the model to follow here.

It sounds like we probably want to use validate-relax in the guidelines so that we have fewer failures.

The packaging committee is still awaiting additional information before it can properly address your request. Please provide that within the next month or this ticket will be closed. (Of course, you can always reopen it if the situation changes) Thanks!

No response; closing. Feel free to reopen if you have more information to add.

Login to comment on this ticket.

Metadata