From cac9c28de5e0ec94284165a5decbd13561699d8f Mon Sep 17 00:00:00 2001 From: Alexander Wilms Date: Sep 07 2023 22:41:09 +0000 Subject: [PATCH 1/2] Update guidelines/modules/ROOT/pages/AppData.adoc to reference new validation tool The command appstreamcli belonging to the appstream project supercedes the command appstream-util, which belongs to the appstream-glib project: https://github.com/hughsie/appstream-glib/issues/471#issuecomment-1650635348 https://github.com/ximion/appstream --- diff --git a/guidelines/modules/ROOT/pages/AppData.adoc b/guidelines/modules/ROOT/pages/AppData.adoc index 18da9d9..248c640 100644 --- a/guidelines/modules/ROOT/pages/AppData.adoc +++ b/guidelines/modules/ROOT/pages/AppData.adoc @@ -14,7 +14,7 @@ Installed `+.metainfo.xml+` files MUST follow the https://www.freedesktop.org/software/appstream/docs/sect-Quickstart-Addons.html[AppStream add-ons specification]. The AppData files MUST correctly validate using -`+appstream-util validate-relax+`. +`+appstreamcli validate org.example.FooBar.metainfo.xml+`. .appdata.xml files NOTE: For historical reasons, AppStream specification also allows using @@ -44,9 +44,9 @@ Here are the contents of a sample application `+.metainfo.xml+` file include::{examplesdir}/app.metainfo.xml[] ---- -Application's AppData file MUST be named with the same root as the .desktop file, -so if the .desktop file is named `+org.gnome.SomeApp.desktop+` -then the AppData file MUST be called `+org.gnome.SomeApp.metainfo.xml+`. +An application's metainfo file MUST be named with the same root as the .desktop file, +so if the .desktop file is named `+org.example.FooBar.desktop+` +then the AppData file MUST be called `+org.example.FooBar.metainfo.xml+`. Here are the contents of a sample addon `+.metainfo.xml+` file (gedit-bookmarks.metainfo.xml): @@ -63,13 +63,13 @@ and also match the `+.metainfo.xml+` filename prefix. == app-data-validate usage Although you can just include the .metainfo.xml file in the package, -you MUST run `+appstream-util validate-relax+` +you MUST run `+appstreamcli validate+` (in `+%check+` or `+%install+`) -and have `+BuildRequires: libappstream-glib+`, +and have `+BuildRequires: appstream+`, to help ensure the validity and safety of the appdata files you're installing. An example: .... -appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml +appstreamcli validate --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml .... From 31dde1616ee8f3df7b15ac3463f4928b54ad286b Mon Sep 17 00:00:00 2001 From: Alexander Wilms Date: Sep 07 2023 22:49:41 +0000 Subject: [PATCH 2/2] Require validation using both appstream-util and appstreamcli --- diff --git a/guidelines/modules/ROOT/pages/AppData.adoc b/guidelines/modules/ROOT/pages/AppData.adoc index 248c640..f218292 100644 --- a/guidelines/modules/ROOT/pages/AppData.adoc +++ b/guidelines/modules/ROOT/pages/AppData.adoc @@ -14,6 +14,7 @@ Installed `+.metainfo.xml+` files MUST follow the https://www.freedesktop.org/software/appstream/docs/sect-Quickstart-Addons.html[AppStream add-ons specification]. The AppData files MUST correctly validate using +`+appstream-util validate-relax org.example.FooBar.metainfo.xml+` and `+appstreamcli validate org.example.FooBar.metainfo.xml+`. .appdata.xml files @@ -63,13 +64,16 @@ and also match the `+.metainfo.xml+` filename prefix. == app-data-validate usage Although you can just include the .metainfo.xml file in the package, +you MUST run `+appstream-util validate-relax+` and you MUST run `+appstreamcli validate+` (in `+%check+` or `+%install+`) +and have `+BuildRequires: libappstream-glib+`, and have `+BuildRequires: appstream+`, to help ensure the validity and safety of the appdata files you're installing. An example: .... +appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml appstreamcli validate --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml ....