Standards/Zypp Updates Status Xml

Un article de openSUSE.

Cette page n'est pas encore traduite (ou pas complètement). Merci de participer au travail si vous en avez le temps et la compétence
Image:susemini.png
Version:
10.2
This spec was introduced with opensuse-updater applet, which appeared in version 10.2
Image:susemini.png
Version:
10.3
This spec has been extended for 10.3. see: zypper xml


Sommaire

Objective

  • User applications, applets and others may want to display the user the number of available updates.
  • Automated programs may want to monitor the availability of new updates and notifiy somebody.
  • CIM providers may want to expose this information to CIM clients.

Design

  • To refresh the system sources you need root permissions. So the wrapper program has root permissions.
  • All the logic is in the helper program, refreshing, caching.
  • The helper is smart and will show cached results if possible.
  • The helper outputs xml.
  • YaST is who actually performs the task of updating. As YaST has cross dektop support, this is actually what we want.

Benefits

  • Consumers take advantage of the zypp solver for patch calculation.
  • No need to link against zypp
  • Launching the helper every X time and parsing the output is all you need.

Specification

If you want to show the available updates (patches) from your system run:

/usr/sbin/zypp-checkpatches-wrapper

Ths is a SUID program, which will refresh system sources and calculate the patch level. The output is an XML file, which is cached in /var/lib/zypp/cache/updates_result.xml


<?xml version='1.0'?>
<update-status version="0.4">
 <errors>
  <error>Some error during calculation happened</error>
 </errors>
 <update-sources>
  <source url="http://ftp.gwdg.de/pub/suse/update/10.1" alias="http://ftp.gwdg.de/pub/suse/update/10.1"/>
 </update-sources>
 <update-list>
 <update category="security" name="java-1_5_0-sun" edition="1438-0">
 <summary>SUN Java packages prior 1.5.0 update 7 allow DOS.</summary>
 <description>Sun Java Runtime Environment (JRE) 1.5.0_6 and earlier, JDK
1.5.0_6 and earlier, and SDK 1.5.0_6 and earlier allows
remote attackers to cause a denial of service (disk
consumption) by using the Font.createFont function to
create temporary files of arbitrary size in the %temp%
directory (CVE-2006-2426).
</description>
<source url="http://ftp.gwdg.de/pub/suse/update/10.1" alias="http://ftp.gwdg.de/pub/suse/update/10.1"/>
</update>
 </update-list>
 <update-summary total="1" security="1"/>
</update-status>

Once you parse the list and display it to the user, you can call yast2 online_update to start an update, or yast2 inst_source (use su if you are not root) to edit the catalogs.