[AppStream] Requiring a specific version of something

Richard Hughes hughsient at gmail.com
Mon Dec 19 08:57:51 UTC 2016


Hi all,

Twice now I've been asked to be able to ignore an appstream entry on
condition of some kind of client check. The first request was to be
able to say "only show this entry in gnome-software > 3.23.1" as the
code that was able to handle the application was only added in that
version so earlier versions would fail to install the app. The other
request is for fwupd where we want to only show the device update IF
fwupd is new enough that it can support the newer version of the
flashing protocol AND the bootloader version of the device is of a
specific version range that can be updated.

I don't think we want the full dependencies thing (requires, suggests,
depends etc) but I do think it makes sense to be able to require the
minimum and maximum versions of the front end tools processing
AppStream metadata. I think these are segmented by class, so if you're
processing the metadata with a different software center you'd just
ignore the metadata item.

Now, the simplest and quickest way to fix these two use cases would be to do:

  <metadata>
    <value key="Requires(gnome-software:project:version_min)">3.23.1</value>
    <value key="Requires(gnome-software:plugin:flatpak)">3.23.1</value>
  </metadata>

and

  <metadata>
    <value key="Requires(fwupd:project:version_min)">0.8.0</value>
    <value key="Requires(fwupd:runtime:version_min)">0.1.0</value>
    <value key="Requires(fwupd:runtime:version_max)">0.0.9</value>
    <value key="Requires(fwupd:bootloader:version_min)">0.9</value>
    <value key="Requires(fwupd:bootloader:version_max)">0.9</value>
  </metadata>

..but it's Christmas and I don't want to upset ximion. :) Another way
of doing this would be:

<x-requires key="fwupd/project/version_min">0.8.0</x-requires>

or:

<requires project="org.gnome.Software" key="ProjectVersionMin">3.23.1</requires>
<requires project="org.gnome.Software" key="PluginExists{flatpak}"/>

or:

<frontend id="org.freedesktop.fwupd">
  <value key="ProjectVersionMin">0.8.0</value>
</frontend>
<frontend id="org.gnome.Software">
  <value key="ProjectVersionMin">3.23.1</value>
</frontend>

...the latter allowing us to cope with different clients, on the basis
we only apply rules to the matching client section, but to ignore the
entry if no client entry is listed. So again, this is a pretty unusual
feature but allows us to deal with deployment of apps and firmware in
the real world.

I'm open for ideas and comments. Thanks!

Richard.


More information about the AppStream mailing list