Imported Upstream version 16.3.1
[platform/upstream/libzypp.git] / doc / autoinclude / ApplicationMetada.doc
1 /**
2
3 \page zypp--appdata Code 12 Application Metadata
4
5 \author Michael Andres <ma@suse.de>
6
7 <HR><!-- ====================================================================== -->
8
9 \section zypp-appdata_intro Intro
10
11 Since Code12 we support \c application as new kind of resolvable object (see e.g. http://worldofgnome.org/gnome-software-on-opensuse). This is short abstract about how a \c package and it's associated \c application are connected metadata wise.
12
13 \code
14 # zypper download virt-manager
15 ...
16 Retrieving package virt-manager-1.2.1-8.1.noarch            (1/1), 354.8 KiB (  2.6 MiB unpacked)
17 (1/1) /var/cache/zypp/packages/server/suse/noarch/virt-manager-1.2.1-8.1.noarch.rpm .......[done]
18 \endcode
19 \code
20 # rpm -qplv /var/cache/zypp/packages/server/suse/noarch/virt-manager-1.2.1-8.1.noarch.rpm | grep /usr/share/appdata
21 -rw-r--r--   1 root root   1119 Sep 18 09:47 /usr/share/appdata/virt-manager.appdata.xml
22 \endcode
23
24 The <tt>package:virt-manager</tt> provides \c application metadata in its file <tt>/usr/share/appdata/virt-manager.appdata.xml</tt>. After installation the presence of <tt>/usr/share/appdata/virt-manager.appdata.xml</tt> indicates the installed <tt>application:'Virtual Machine Manager'</tt>. The connection is provided by the <tt>package:virt-manager</tt> \c appdata provides...
25
26 \code
27 # zypp-NameReqPrv -D virt-manager
28 ...
29 (976)virt-manager-1.2.1-8.1.noarch(@System)
30  PROVIDES (5){
31   application()
32   appdata()
33   appdata(virt-manager.appdata.xml)
34           ^^^^^^^^^^^^
35 \endcode
36
37 ...matching the content of \c /usr/share/appdata/virt-manager.appdata.xml:
38
39 \code
40 # less /usr/share/appdata/virt-manager.appdata.xml
41 <application>
42  <id type="desktop">virt-manager.desktop</id>
43   ^^                ^^^^^^^^^^^^
44  <metadata_license>CC0-1.0</metadata_license>
45  <project_license>GPL-2.0+</project_license>
46  <name>Virtual Machine Manager</name>
47 \endcode
48
49 To establish this connection for uninstalled \c package/application pairs, the repository metadata must provide the \c appdata.xml files for the included packages. This is done in for \c susetags repos in \c suse/setup/descr/appdata.xml.gz, for \c rpmmd in <tt>repodata/CHCKSUM-appdata.xml.gz</tt>.
50
51
52 \section zypp-appdata_wrong_appdata Missing or wrong appdata
53
54 \code
55 # zypper se -s -t application 'Virtual Machine Manager'
56 ...
57 S | Name                    | Type        | Version | Arch   | Repository
58 --+-------------------------+-------------+---------+--------+------------------
59 i | Virtual Machine Manager | application |         | noarch | (System Packages)
60 \endcode
61 \code
62 # zypper se -s virt-manager
63 ...
64 S | Name                | Type       | Version   | Arch   | Repository
65 --+---------------------+------------+-----------+--------+------------------
66 i | virt-manager        | package    | 1.2.1-8.1 | noarch | SLE-12-SP1-Server
67 \endcode
68
69 \note While the <tt>package:virt-manager</tt> is installed and also available in the SLE-12-SP1-Server repository, <tt>(System Packages)</tt> indicates that the \c application is installed, but not provided by any repository. This usually happens if the repository provides wrong appdata, or no appdata at all.
70
71 \code
72 # zypper in -f virt-manager
73 ...
74 Forcing installation of 'virt-manager-1.2.1-8.1.noarch' from repository 'SLE-12-SP1-Server'.
75 Resolving package dependencies...
76
77 The following application is going to be REMOVED:
78   "Virtual Machine Manager"
79
80 The following package is going to be reinstalled:
81   virt-manager
82 \endcode
83
84 \c Zypper can not 'see' that the new package also transports a new application. Due to this \c zypper must assume the installed application gets deleted, when the package is reinstalled or updated.
85
86 \code
87 \endcode
88 */