Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 67e32647b06c0323bf90c6b54a6438d1 > files > 333

rpm-apidocs-4.4.2.3-34.el5.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>rpm: Immutable header regions in rpm-4.0.1 and later</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul></div>
<h1><a class="anchor" name="hregions">Immutable header regions in rpm-4.0.1 and later</a></h1>The header data structure has changed in rpm-4.0.[12] to preserve the original header from a package. The goal is to keep the original header intact so that metadata can be verified separately from the payload by the RHN up2date client and by the rpm command line verify mode using signatures saved in the rpm database. I believe the change is entirely forward and backward compatible, and will not require any artifacts like changing the version number of packaging or adding an "rpmlib(...)" tracking dependency. We'll see ...<p>
Here's a short description of the change. An rpm header has three sections: <div class="fragment"><pre class="fragment">	1) intro		(# entries in index, # bytes of data)
	2) index		16 byte entries, one per tag, big endian
	3) data			tag values, properly aligned, big endian
</pre></div><p>
Representing sections in the header (ignoring the intro) with <div class="fragment"><pre class="fragment">	A,B,C			index entries sorted by tag number
	a,b,c			variable length entry data
	| 			boundary between index/data
</pre></div> a header with 3 tag/value pairs (A,a) can be represented something like <div class="fragment"><pre class="fragment">	ABC|abc
</pre></div><p>
The change is to introduce a new tag that keeps track of a contiguous region (i.e. the original header). Representing the boundaries with square/angle brackets, an "immutable region" in the header thus becomes <div class="fragment"><pre class="fragment">	[ABC|abc]
</pre></div> or more generally (spaces added for clarity) <div class="fragment"><pre class="fragment">	[ABC&gt; QRS | &lt;abc] qrs
</pre></div> or with concatenated regions (not implemented yet) <div class="fragment"><pre class="fragment">	[ABC&gt; [DEF&gt; QRS | &lt;abc] &lt;def] qrs
</pre></div> or with nested regions (not implemented yet) <div class="fragment"><pre class="fragment">	[ABC [DEF&gt;&gt; QRS | &lt;&lt;abc] def] qrs
</pre></div><p>
<dl compact><dt><b><a class="el" href="todo.html#_todo000015">Todo:</a></b></dt><dd>Either concatenated/nested regions may be used to implement a metarpm, aka a package of packages, dunno how, when, or even if, yet.</dd></dl>
What complicates the above is legacy issues, as various versions of rpm have added/deleted/modified entries in the header freely. Thus, representing altered tag entries/data with a '.', there is a need to preserve deleted information something like<p>
<div class="fragment"><pre class="fragment">	[A.C&gt; QRS XYZ | &lt;a.c] qrs xyz
</pre></div><p>
<dl compact><dt><b>Note:</b></dt><dd>This is basically the change that replaces the filename with a {dirname,basename,dirindex} triple between rpm-3.x and rpm-4.x.</dd></dl>
or<p>
<div class="fragment"><pre class="fragment">	[AB.&gt; QRS D | &lt;ab.] qrs d
</pre></div><p>
<dl compact><dt><b>Note:</b></dt><dd>The header is no longer sorted because of replacing Cc with Dd.</dd></dl>
and yet permit retrieval of the original<p>
<div class="fragment"><pre class="fragment">	[ABC|abc]
</pre></div><p>
region. PITA, really.<p>
What made header regions trickier yet is the desire to have an implementation that is both backward and forward compatible. I won't bore you with the tedious details.<p>
However, even after doing regressions against supported Red Hat releases, there's a Great Big Universe of rpm packages out there, and I'm *very* interested in hearing (as bug reports against rpm at <a href="http://bugzilla.redhat.com">http://bugzilla.redhat.com</a>) about any and all problems with header regions in rpm-4.0.1. <hr size="1"><address style="align: right;"><small>Generated on 1 Oct 2013 for rpm by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>