hughsie / oars

The Open Age Ratings Service
GNU Lesser General Public License v2.1
22 stars 6 forks source link

Answering none to all questions leads failing validation with appstreamcli validate #18

Closed aral closed 5 years ago

aral commented 5 years ago

To reproduce

Using the Open Age Ratings Service (https://hughsie.github.io/oars/generate.html):

  1. Select “Application that does not use the Internet”

  2. Select either OARS version 1.0 or 1.1 (same result in each)

  3. For every other question, leave the None setting.

    At the end you will get:

    <content_rating type="oars-1.1" />
  4. Add this to your appdata.xml and validate it using appstreamcli validate …

What should happen

It should validate.

What actually happens

Validation fails with the following warning:

W - ind.ie.Gnomit.appdata.xml.in:ind.ie.Gnomit.desktop:47
    Found empty 'content_rating' tag.

Note: Validation passes with appstream-util validate-relax

har9862 commented 5 years ago

The specs should probably also be updated to accommodate omitting all tags if all of its values are set to none, as it now contradicts this:

The must have children which each have an id property indicating the specific section that is rated.

ximion commented 5 years ago

Having an empty content_rating tag was not originally intended by the specification, so OARS changing that without changing the spec first wasn't so awesome. However, the validator has been adjusted meanwhile, so appstreamcli will now consider empty content_rating tags to be valid. Update to AppStream >= 0.12.3 to get the change. So this issue could likely be closed.

elelay commented 5 years ago

@ximion appstreamcli 0.12.4 still shows the warning:

> appstreamcli --version
AppStream version: 0.12.4
> appstreamcli validate share/metainfo/org.gpodder.gpodder.appdata.xml
W - org.gpodder.gpodder.appdata.xml:org.gpodder.gpodder:18
    Found empty 'content_rating' tag.

Validation failed: warnings: 1

Is it expected?

ximion commented 5 years ago

@elelay No - are you sure you also have the right version of libappstream installed, in addition to appstreamcli? (ascli should actually show a mismatch when --version is passed in that case...)

elelay commented 5 years ago

No mismatch reported. I'm on ArchLinux, fully up to date. Could it be something with org.gpodder.gpodder.appdata.xml?

> ls /usr/lib/libappstream.so*
/usr/lib/libappstream.so  /usr/lib/libappstream.so.0.12.4  /usr/lib/libappstream.so.4
tsdgeos commented 5 years ago

This is still happening

$ appstreamcli --version AppStream version: 0.12.6

$ appstreamcli validate ../src/org.kde.kgeography.appdata.xml W - org.kde.kgeography.appdata.xml:org.kde.kgeography.desktop:248 Found empty 'content_rating' tag.

Can we please get this fixed?

hughsie commented 5 years ago

AppStream version: 0.12.6

Then it's appstreamcli validate at fault, not OARS, sorry.

ximion commented 5 years ago

This was a regression that is fixed in newer versions of AppStream (currently not released).

tsdgeos commented 5 years ago

@ximion any ETA for it?