@jbrobst
Copy link

jbrobst commented Aug 17, 2018

After running apt update today I got a fatal error from appstreamcli refresh-cache. I believe the cause is the new version of stellarium uploaded to Debian unstable yesterday, whose appdata XML contains a content_rating tag without any content_attribute children. It is unclear to me whether the appstream documentation forbids this:

The <content_rating/> must have <content_attribute/> children which each have an id property indicating the specific section that is rated.

If it is forbidden, I think "must have one or more <content_attribute/> children" would be clearer. The code does assume this is the case, as as_content_rating_to_variant calls g_variant_builder_end(&values_b), which is an error if the indefinite array variant values_b has not had anything added.

On the other hand, the user that submitted the PR to stellarium seems to have used the OARS generation tool linked by the documentation for content_rating, which does generate a childless content_rating tag if you answer "None" to all of the questions.

So, either appstream needs to be modified to accept a content_rating tag with no children or the OARS tool needs to change what it generates when all questions are answered with "None" (perhaps along with the clarification to the content_rating documentation above).