libzypp  15.28.6
Code 12 Application Metadata
Author
Michael Andres ma@su.nosp@m.se.d.nosp@m.e

Intro

Since Code12 we support application as new kind of resolvable object (see e.g. http://worldofgnome.org/gnome-software-on-opensuse). This is short abstract about how a package and it's associated application are connected metadata wise.

# zypper download virt-manager
...
Retrieving package virt-manager-1.2.1-8.1.noarch (1/1), 354.8 KiB ( 2.6 MiB unpacked)
(1/1) /var/cache/zypp/packages/server/suse/noarch/virt-manager-1.2.1-8.1.noarch.rpm .......[done]
# rpm -qplv /var/cache/zypp/packages/server/suse/noarch/virt-manager-1.2.1-8.1.noarch.rpm | grep /usr/share/appdata
-rw-r--r-- 1 root root 1119 Sep 18 09:47 /usr/share/appdata/virt-manager.appdata.xml

The package:virt-manager provides application metadata in its file /usr/share/appdata/virt-manager.appdata.xml. After installation the presence of /usr/share/appdata/virt-manager.appdata.xml indicates the installed application:'Virtual Machine Manager'. The connection is provided by the package:virt-manager appdata provides...

# zypp-NameReqPrv -D virt-manager
...
(976)virt-manager-1.2.1-8.1.noarch(@System)
PROVIDES (5){
application()
appdata()
appdata(virt-manager.appdata.xml)
^^^^^^^^^^^^

...matching the content of /usr/share/appdata/virt-manager.appdata.xml:

# less /usr/share/appdata/virt-manager.appdata.xml
<application>
<id type="desktop">virt-manager.desktop</id>
^^ ^^^^^^^^^^^^
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>Virtual Machine Manager</name>

To establish this connection for uninstalled package/application pairs, the repository metadata must provide the appdata.xml files for the included packages. This is done in for susetags repos in suse/setup/descr/appdata.xml.gz, for rpmmd in repodata/CHCKSUM-appdata.xml.gz.

Missing or wrong appdata

# zypper se -s -t application 'Virtual Machine Manager'
...
S | Name | Type | Version | Arch | Repository
--+-------------------------+-------------+---------+--------+------------------
i | Virtual Machine Manager | application | | noarch | (System Packages)
# zypper se -s virt-manager
...
S | Name | Type | Version | Arch | Repository
--+---------------------+------------+-----------+--------+------------------
i | virt-manager | package | 1.2.1-8.1 | noarch | SLE-12-SP1-Server
Note
While the package:virt-manager is installed and also available in the SLE-12-SP1-Server repository, (System Packages) indicates that the application is installed, but not provided by any repository. This usually happens if the repository provides wrong appdata, or no appdata at all.
# zypper in -f virt-manager
...
Forcing installation of 'virt-manager-1.2.1-8.1.noarch' from repository 'SLE-12-SP1-Server'.
Resolving package dependencies...
The following application is going to be REMOVED:
"Virtual Machine Manager"
The following package is going to be reinstalled:
virt-manager

Zypper can not 'see' that the new package also transports a new application. Due to this zypper must assume the installed application gets deleted, when the package is reinstalled or updated.