1
/*! \page hregions Immutable header regions in rpm-4.0.1 and later
3
The header data structure has changed in rpm-4.0.[12] to preserve the
4
original header from a package. The goal is to keep the original
5
header intact so that metadata can be verified separately from the
6
payload by the RHN up2date client and by the rpm commmand line verify
7
mode using signatures saved in the rpm database. I believe the change
8
is entirely forward and backward compatible, and will not require
9
any artifacts like changing the version number of packaging or
10
adding an "rpmlib(...)" tracking dependendency. We'll see ...
12
Here's a short description of the change. An rpm header has three sections:
14
1) intro (# entries in index, # bytes of data)
15
2) index 16 byte entries, one per tag, big endian
16
3) data tag values, properly aligned, big endian
19
Representing sections in the header (ignoring the intro) with
21
A,B,C index entries sorted by tag number
22
a,b,c variable length entry data
23
| boundary between index/data
25
a header with 3 tag/value pairs (A,a) can be represented something like
30
The change is to introduce a new tag that keeps track of a contiguous
31
region (i.e. the original header). Representing the boundaries with
32
square/angle brackets, an "immutable region" in the header thus becomes
36
or more generally (spaces added for clarity)
40
or with concatenated regions (not implemented yet)
42
[ABC> [DEF> QRS | <abc] <def] qrs
44
or with nested regions (not implemented yet)
46
[ABC [DEF>> QRS | <<abc] def] qrs
49
\todo Either concatenated/nested regions may be used to implement
50
a metarpm, aka a package of packages, dunno how, when, or even if, yet.
52
What complicates the above is legacy issues, as various versions of rpm
53
have added/deleted/modified entries in the header freely. Thus, representing
54
altered tag entries/data with a '.', there is a need to preserve deleted
55
information something like
58
[A.C> QRS XYZ | <a.c] qrs xyz
61
\note This is basically the change that replaces the filename with
62
a {dirname,basename,dirindex} triple between rpm-3.x and rpm-4.x.
67
[AB.> QRS D | <ab.] qrs d
70
\note The header is no longer sorted because of replacing Cc with Dd.
72
and yet permit retrieval of the original
80
What made header regions trickier yet is the desire to have an implementation
81
that is both backward and forward compatible. I won't bore you with the
84
However, even after doing regressions against supported Red Hat releases,
85
there's a Great Big Universe of rpm packages out there, and I'm *very*
86
interested in hearing (as bug reports against rpm at http://bugzilla.redhat.com)
87
about any and all problems with header regions in rpm-4.0.1.