Standards/Rpm Metadata

From openSUSE


Software Repositories: YaST - YaST Content - Metadata Descriptions - Media - Repomd


Contents

rpm XML Metadata

rpm XML Metadata format is mostly used for online repositories on the internet. It has its origins in the YUM package manager.

Just lately it was extended to support repositories splitted across multiple media.

Repository layout

Repositories are represented in XML - actually, the repository metadata is stored in gzipped XML files, in a repodata subdirectory on the server, for example:

http://ftp.gwdg.de/pub/linux/misc/suser-guru/rpm/10.1/RPMS/repodata/

with the following files:

repomd.xml
main repository file, very small, contains references to the others, as well as checksums and timestamps;
primary.xml.gz
contains the most important information: list of packages (with version, release, architecture), what it requires, size of the package, summary, description, etc....
filelists.xml.gz
contains the list of files that are included in the packages
other.xml.gz
not used by all package managers, it contains the changelog information of every package.

The repomd file is the repository index. It list one or more metadata entries, using the data tag, which can be:

  • a primary file (package lists)
  • filelists (files in packages)
  • groups (predefined selection of packages)
  • patches list
  • other (changelogs and extra data)

Metadata Signature and Checksum

Read the Metadata Signature model.

Based on this model, the master index is repomd.xml, and the signature has to be provided as repomd.xml.asc.

The public part of the key used to sign the master index can be provided as repomd.xml.key

External links

Read here for more information on RPM-MD

Extensions

Extensions are used to support

Proposed Extensions

Outdated Metadata Hint

Use Case

Joe user has an update repo pointing to a mirror directly (no redirector). The mirror goes out of sync (however it is still reachable). He does not receive any warning, and meanwhile the main repo has lot of updates.

Expected result

The server has a hint on how often the metadata is regenerated due to a change. The client could detect this and hint the user that the metadata has not been updated since long time.

Requirements

  • The value is only a hint. The user should be able to disable or alter it.

Proposed implementation

An attribute "generated" is added to repomd section:

<repomd generated="sometimestamp">
 <data type="primary">
 <location href="repodata/primary.xml.gz"/>

Note: as an alternative, this could be just be stored in a GENERATED ascii file in the same directory level or one up.

The repository is added via a .repo file which suggests a outdated expiry time:

foo.repo:
[foo]
name=foo repository
url=http://foo.com
outdatedhint=1 week

Implementation pros

If the repo is added manually via name/url, then no setting is used, and therefore the functionality is disabled.

The user can disable the check by removing the property.

Implementation cons

The repo can't change the value of the expire later. A different design would be needed for this, like also having this value in the xml file, and use the repo only to enable or disable the hinting.

Required changes

  • Autobuild: generate the attribute
  • libzypp: save the attribute in solv file: Expose the values and a convenience method couldBeOutdated() hint in the Repo api.
  • zypper and selector: check for this flag
  • Registration: set the value correctly, or get the update repo using a .repo file with all settings.