Appdata custom purism tags

Hi, when I try to validate an appdata file, appdatacli reports the following warning: “custom-key-duplicated Purism::form_factor”.

appstreamcli validate --pedantic data/io.github.mrvladus.List.metainfo.xml 
E: @APP_ID@:16: custom-key-duplicated Purism::form_factor

Comparing the custom tags in that appdata file with those in many GNOME projects, they seem to be the same:

  <custom>
    <value key="Purism::form_factor">workstation</value>
    <value key="Purism::form_factor">mobile</value>
  </custom>

According to the Freedesktop documentation, the <custom/> tag is an optional tag that serves as a key-value store for custom values not covered by the AppStream specification.

Here’s an example from the documentation:

<custom>
  <value key="MyCorp::app_color">#FF0000</value>
  <value key="MyCorp::special_id">284fd262-6870-42a6-89a4-b189d3109e3e</value>
</custom>

To resolve the “custom-key-duplicated” warning, I merged the Purism values like this, which made the error disappear:

  <custom>
    <value key="Purism::form_factor">workstation,mobile</value>
  </custom>

Purism’s blog indicates that GNOME’s usage is valid.

In conclusion, my question is: Do I need to change the Purism::form_factor entries?

Hi, you need to simply delete these entries. It’s not expected to be a comma-separated list, and Purism doesn’t use it anymore anyway.

More info here

1 Like

FWIW, we can get the complete list of apps using the Purism::form_factor tags from the appstream hints (warnings / errors etc) in https://appstream.debian.org/hints/

E.g From https://appstream.debian.org/hints/sid/main/Hints-amd64.json.gz, we can write a simple JSON parser in python to get the complete list of apps, and replace them.

{
    "hints": {
        "org.gnome.Sudoku": [
...
...
            {
                "tag": "asv-custom-key-duplicated",
                "vars": {
                    "hint": "Purism::form_factor",
                    "location": ":403"
                }
            }
        ]
    },
    "package": "gnome-sudoku\/1:44.0-2\/amd64"
},
...
...
{
    "hints": {
        "org.gnome.Usage": [
         {
                "tag": "asv-custom-key-duplicated",
                "vars": {
                    "hint": "Purism::form_factor",
                    "location": ":143"
                }
            },
        ]
    },
    "package": "gnome-usage\/45.0-1\/amd64"
},

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.