RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 24-Nov-2007 23:07:31
Branch: HEAD Handle: 2007112422072704
Modified files:
rpm CHANGES
rpm/build files.c pack.c parsePreamble.c parseSpec.c
reqprov.c spec.c
rpm/lib depends.c formats.c package.c psm.c rpmchecksig.c
rpmds.c rpmfc.c rpmfi.c rpminstall.c rpmrollback.c
rpmte.c rpmts.c transaction.c
rpm/python header-py.c
rpm/rpmdb fprint.c hdrNVR.c hdrfmt.c hdrinline.h header.c
header.h librpmdb.vers pkgio.c rpmdb.c rpmtag.h
signature.c
rpm/tools rpm2cpio.c rpmcache.c
Log:
- finalize headerGet, add to the ABI, remove HGE_t goop.
Summary:
Revision Changes Path
1.1885 +1 -0 rpm/CHANGES
1.292 +5 -9 rpm/build/files.c
2.256 +7 -11 rpm/build/pack.c
2.145 +4 -8 rpm/build/parsePreamble.c
2.115 +1 -2 rpm/build/parseSpec.c
1.81 +4 -5 rpm/build/reqprov.c
2.162 +3 -5 rpm/build/spec.c
1.365 +7 -10 rpm/lib/depends.c
2.122 +2 -3 rpm/lib/formats.c
2.193 +3 -4 rpm/lib/package.c
2.266 +32 -42 rpm/lib/psm.c
1.198 +4 -8 rpm/lib/rpmchecksig.c
2.84 +9 -12 rpm/lib/rpmds.c
1.41 +2 -3 rpm/lib/rpmfc.c
2.103 +17 -19 rpm/lib/rpmfi.c
1.185 +3 -4 rpm/lib/rpminstall.c
1.27 +5 -8 rpm/lib/rpmrollback.c
2.70 +10 -13 rpm/lib/rpmte.c
2.125 +2 -3 rpm/lib/rpmts.c
1.356 +3 -6 rpm/lib/transaction.c
1.84 +3 -5 rpm/python/header-py.c
1.23 +4 -5 rpm/rpmdb/fprint.c
1.37 +3 -6 rpm/rpmdb/hdrNVR.c
1.42 +7 -21 rpm/rpmdb/hdrfmt.c
1.41 +0 -28 rpm/rpmdb/hdrinline.h
1.134 +78 -103 rpm/rpmdb/header.c
1.75 +0 -29 rpm/rpmdb/header.h
1.32 +1 -0 rpm/rpmdb/librpmdb.vers
1.60 +2 -4 rpm/rpmdb/pkgio.c
1.220 +15 -21 rpm/rpmdb/rpmdb.c
1.13 +12 -0 rpm/rpmdb/rpmtag.h
1.33 +1 -2 rpm/rpmdb/signature.c
2.2 +2 -3 rpm/tools/rpm2cpio.c
2.25 +1 -2 rpm/tools/rpmcache.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.1884 -r1.1885 CHANGES
--- rpm/CHANGES 24 Nov 2007 21:01:44 -0000 1.1884
+++ rpm/CHANGES 24 Nov 2007 22:07:27 -0000 1.1885
@@ -1,4 +1,5 @@
5.0a2 -> 5.0a3:
+ - jbj: finalize headerGet, add to the ABI, remove HGE_t goop.
- jbj: re-add headerSprintf to the ABI, removing wrappers/methods.
- jbj: move headerSprintf goop out of header.c into hdrfmt.c.
- jbj: python: hmmm, add header extensions to dictionary correctly.
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/files.c
============================================================================
$ cvs diff -u -r1.291 -r1.292 files.c
--- rpm/build/files.c 24 Nov 2007 19:46:05 -0000 1.291
+++ rpm/build/files.c 24 Nov 2007 22:07:28 -0000 1.292
@@ -275,7 +275,6 @@
/*@globals internalState @*/
/*@modifies internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
uint32_t currentTime = time(NULL);
uint32_t * mtime;
@@ -283,10 +282,10 @@
int i;
he->tag = RPMTAG_FILEMTIMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
mtime = he->p.ui32p;
he->tag = RPMTAG_OLDFILENAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
for (i = 0; i < he->c; i++) {
xx = currentTime - mtime[i];
@@ -1170,7 +1169,6 @@
static void compressFilelist(Header h)
/*@modifies h @*/
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HRE_t hre = headerRemoveExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
@@ -1197,7 +1195,7 @@
}
he->tag = RPMTAG_OLDFILENAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fileNames = he->p.argv;
count = he->c;
if (!xx || fileNames == NULL || count <= 0)
@@ -2245,7 +2243,6 @@
pkg->cpioList, pkg->fileList, pkg->specialDoc, pkg->header,
rpmGlobalMacroContext, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
struct FileList_s fl;
char *s, **files, **fp;
@@ -2310,7 +2307,7 @@
fl.buildRootURL = rpmGenPath(spec->rootURL, "%{?buildroot}", NULL);
he->tag = RPMTAG_DEFAULTPREFIX;
- xx = hge(pkg->header, he, 0);
+ xx = headerGet(pkg->header, he, 0);
fl.prefix = he->p.str;
fl.fileCount = 0;
@@ -2792,7 +2789,6 @@
/*@globals check_fileList @*/
/*@modifies check_fileList @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
Package pkg;
int res = 0;
@@ -2809,7 +2805,7 @@
(void) headerMacrosLoad(pkg->header);
he->tag = RPMTAG_NVRA;
- xx = hge(pkg->header, he, 0);
+ xx = headerGet(pkg->header, he, 0);
rpmlog(RPMLOG_NOTICE, _("Processing files: %s\n"), he->p.str);
he->p.ptr = _free(he->p.ptr);
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/pack.c
============================================================================
$ cvs diff -u -r2.255 -r2.256 pack.c
--- rpm/build/pack.c 24 Nov 2007 19:46:05 -0000 2.255
+++ rpm/build/pack.c 24 Nov 2007 22:07:28 -0000 2.256
@@ -177,7 +177,6 @@
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HRE_t hre = headerRemoveExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
@@ -185,7 +184,7 @@
int xx;
he->tag = tag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (xx) {
appendLineStringBuf(sb, he->p.str);
(void) hre(h, he, 0);
@@ -471,7 +470,6 @@
void providePackageNVR(Header h)
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char *N, *V, *R;
@@ -494,7 +492,7 @@
pEVR = p = alloca(21 + strlen(V) + 1 + strlen(R) + 1);
*p = '\0';
he->tag = RPMTAG_EPOCH;
- gotE = hge(h, he, 0);
+ gotE = headerGet(h, he, 0);
E = (he->p.ui32p ? he->p.ui32p[0] : 0);
he->p.ptr = _free(he->p.ptr);
if (gotE) {
@@ -508,7 +506,7 @@
* If no provides at all are available, we can just add.
*/
he->tag = RPMTAG_PROVIDENAME;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
provides = he->p.argv;
providesCount = he->c;
if (!xx)
@@ -518,7 +516,7 @@
* Otherwise, fill in entries on legacy packages.
*/
he->tag = RPMTAG_PROVIDEVERSION;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
providesEVR = he->p.argv;
if (!xx) {
for (i = 0; i < providesCount; i++) {
@@ -545,7 +543,7 @@
}
he->tag = RPMTAG_PROVIDEFLAGS;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
provideFlags = he->p.ui32p;
/*@-nullderef@*/ /* LCL: providesEVR is not NULL */
@@ -597,7 +595,6 @@
rpmRC writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
CSA_t csa, char *passPhrase, const char **cookie)
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
FD_t fd = NULL;
@@ -912,7 +909,7 @@
/* XXX Fish the pkgid out of the signature header. */
if (sigh != NULL && pkgidp != NULL) {
he->tag = RPMSIGTAG_MD5;
- xx = hge(sigh, he, 0);
+ xx = headerGet(sigh, he, 0);
if (he->t == RPM_BIN_TYPE && he->p.ptr != NULL && he->c == 16)
*pkgidp = he->p.ui8p; /* XXX memory leak */
}
@@ -951,7 +948,6 @@
/*@-boundswrite@*/
int packageBinaries(Spec spec)
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
struct cpioSourceArchive_s csabuf;
@@ -1025,7 +1021,7 @@
binFormat = _free(binFormat);
if (binRpm == NULL) {
he->tag = RPMTAG_NVRA;
- xx = hge(pkg->header, he, 0);
+ xx = headerGet(pkg->header, he, 0);
rpmlog(RPMLOG_ERR, _("Could not generate output "
"filename for package %s: %s\n"), he->p.str, errorString);
he->p.ptr = _free(he->p.ptr);
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parsePreamble.c
============================================================================
$ cvs diff -u -r2.144 -r2.145 parsePreamble.c
--- rpm/build/parsePreamble.c 10 Nov 2007 18:06:41 -0000 2.144
+++ rpm/build/parsePreamble.c 24 Nov 2007 22:07:28 -0000 2.145
@@ -220,12 +220,11 @@
static int isMemberInEntry(Header h, const char *name, rpmTag tag)
/*@*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
int xx;
he->tag = tag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (!xx)
return -1;
/*@-boundsread@*/
@@ -468,7 +467,6 @@
spectag stashSt(Spec spec, Header h, int tag, const char * lang)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
spectag t = NULL;
int xx;
@@ -487,7 +485,7 @@
t->t_msgid = NULL;
if (!(t->t_lang && strcmp(t->t_lang, RPMBUILD_DEFAULT_LANG))) {
he->tag = RPMTAG_NAME;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (xx) {
char buf[1024];
sprintf(buf, "%s(%s)", he->p.str, tagName(tag));
@@ -525,7 +523,6 @@
pkg->header, pkg->autoProv, pkg->autoReq, pkg->icon,
rpmGlobalMacroContext, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
char * field = spec->line;
@@ -635,7 +632,7 @@
case RPMTAG_PREFIXES:
addOrAppendListEntry(pkg->header, tag, field);
he->tag = tag;
- xx = hge(pkg->header, he, 0);
+ xx = headerGet(pkg->header, he, 0);
if (tag == RPMTAG_PREFIXES)
while (he->c--) {
if (he->p.argv[he->c][0] != '/') {
@@ -975,7 +972,6 @@
/* XXX should return rpmParseState, but RPMRC_FAIL forces int return. */
int parsePreamble(Spec spec, int initialPackage)
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmParseState nextPart;
@@ -1008,7 +1004,7 @@
/* Construct the package */
if (flag == PART_SUBNAME) {
he->tag = RPMTAG_NAME;
- xx = hge(spec->packages->header, he, 0);
+ xx = headerGet(spec->packages->header, he, 0);
sprintf(NVR, "%s-%s", he->p.str, name);
he->p.ptr = _free(he->p.ptr);
} else
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/parseSpec.c
============================================================================
$ cvs diff -u -r2.114 -r2.115 parseSpec.c
--- rpm/build/parseSpec.c 20 Nov 2007 23:50:56 -0000 2.114
+++ rpm/build/parseSpec.c 24 Nov 2007 22:07:28 -0000 2.115
@@ -434,7 +434,6 @@
int recursing, const char *passPhrase,
const char *cookie, int anyarch, int force, int verify)
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmParseState parsePart = PART_PREAMBLE;
@@ -605,7 +604,7 @@
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
he->tag = RPMTAG_NVRA;
- xx = hge(pkg->header, he, 0);
+ xx = headerGet(pkg->header, he, 0);
rpmlog(RPMLOG_ERR, _("Package has no %%description: %s\n"),
he->p.str);
he->p.ptr = _free(he->p.ptr);
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/reqprov.c
============================================================================
$ cvs diff -u -r1.80 -r1.81 reqprov.c
--- rpm/build/reqprov.c 10 Nov 2007 18:06:41 -0000 1.80
+++ rpm/build/reqprov.c 24 Nov 2007 22:07:28 -0000 1.81
@@ -14,7 +14,6 @@
const char * N, const char * EVR, rpmsenseFlags Flags,
uint32_t index)
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char ** names;
@@ -61,7 +60,7 @@
/* Check for duplicate dependencies. */
he->tag = nametag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
names = he->p.argv;
len = he->c;
if (xx) {
@@ -72,15 +71,15 @@
if (flagtag) {
he->tag = versiontag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
versions = he->p.argv;
he->tag = flagtag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
flags = he->p.ui32p;
}
if (indextag) {
he->tag = indextag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
indexes = he->p.ui32p;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/build/spec.c
============================================================================
$ cvs diff -u -r2.161 -r2.162 spec.c
--- rpm/build/spec.c 24 Nov 2007 19:46:05 -0000 2.161
+++ rpm/build/spec.c 24 Nov 2007 22:07:28 -0000 2.162
@@ -67,7 +67,6 @@
/*@-boundswrite@*/
int lookupPackage(Spec spec, const char *name, int flag, /*@out@*/Package *pkg)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char *fullName;
Package p;
@@ -84,7 +83,7 @@
{ char *n;
if (flag == PART_SUBNAME) {
he->tag = RPMTAG_NAME;
- xx = hge(spec->packages->header, he, 0);
+ xx = headerGet(spec->packages->header, he, 0);
fullName = n = alloca(strlen(he->p.str) + 1 + strlen(name) + 1);
n = stpcpy(n, he->p.str);
he->p.ptr = _free(he->p.ptr);
@@ -101,7 +100,7 @@
/* Locate package with fullName */
for (p = spec->packages; p != NULL; p = p->next) {
he->tag = RPMTAG_NAME;
- xx = hge(p->header, he, 0);
+ xx = headerGet(p->header, he, 0);
if (he->p.str && !strcmp(fullName, he->p.str)) {
he->p.ptr = _free(he->p.ptr);
break;
@@ -635,7 +634,6 @@
/*@globals fileSystem @*/
/*@modifies spec->sl->sl_lines[], fileSystem @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
Header h;
speclines sl = spec->sl;
@@ -671,7 +669,7 @@
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
h = pkg->header;
he->tag = RPMTAG_NAME;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (!strcmp(he->p.str, fmt)) {
he->p.ptr = _free(he->p.ptr);
/*@innerbreak@*/ break;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/depends.c
============================================================================
$ cvs diff -u -r1.364 -r1.365 depends.c
--- rpm/lib/depends.c 22 Nov 2007 22:28:14 -0000 1.364
+++ rpm/lib/depends.c 24 Nov 2007 22:07:28 -0000 1.365
@@ -151,17 +151,16 @@
static int rpmHeadersIdentical(Header first, Header second)
/*@*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char * one, * two;
int rc = 0;
int xx;
he->tag = RPMTAG_HDRID;
- xx = hge(first, he, 0);
+ xx = headerGet(first, he, 0);
one = he->p.str;
he->tag = RPMTAG_HDRID;
- xx = hge(second, he, 0);
+ xx = headerGet(second, he, 0);
two = he->p.str;
if (one && two)
@@ -191,7 +190,6 @@
int rpmtsAddInstallElement(rpmts ts, Header h,
fnpyKey key, int upgrade, rpmRelocation relocs)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmdepFlags depFlags = rpmtsDFlags(ts);
uint32_t tscolor = rpmtsColor(ts);
@@ -231,16 +229,16 @@
* Check platform affinity of binary packages.
*/
he->tag = RPMTAG_ARCH;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
arch = he->p.str;
he->tag = RPMTAG_OS;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
os = he->p.str;
if (nplatpat > 1) {
const char * platform = NULL;
he->tag = RPMTAG_PLATFORM;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
platform = he->p.str;
if (!xx || platform == NULL)
platform = rpmExpand(arch, "-unknown-", os, NULL);
@@ -249,7 +247,7 @@
if (rc <= 0) {
rpmps ps = rpmtsProblems(ts);
he->tag = RPMTAG_NVRA;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
assert(he->p.str != NULL);
rpmpsAppend(ps, RPMPROB_BADPLATFORM, he->p.str, key,
platform, NULL, NULL, 0);
@@ -1330,7 +1328,6 @@
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, mi, rpmGlobalMacroContext, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmdepFlags depFlags = rpmtsDFlags(ts);
uint32_t tscolor = rpmtsColor(ts);
@@ -1348,7 +1345,7 @@
int rc;
he->tag = RPMTAG_NVRA;
- rc = hge(h, he, 0);
+ rc = headerGet(h, he, 0);
assert(he->p.str != NULL);
if (!(depFlags & RPMDEPS_FLAG_NOREQUIRES))
requires = rpmdsNew(h, RPMTAG_REQUIRENAME, scareMem);
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/formats.c
============================================================================
$ cvs diff -u -r2.121 -r2.122 formats.c
--- rpm/lib/formats.c 24 Nov 2007 17:18:57 -0000 2.121
+++ rpm/lib/formats.c 24 Nov 2007 22:07:28 -0000 2.122
@@ -57,7 +57,6 @@
/*@modifies he, rpmGlobalMacroContext,
fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
rpmTagData fnames = { .ptr = NULL };
rpmTagData fsizes = { .ptr = NULL };
rpmTagData p;
@@ -68,10 +67,10 @@
p.ptr = he->p.ptr;
he->tag = RPMTAG_FILESIZES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fsizes.ptr = he->p.ptr;
he->tag = RPMTAG_FILEPATHS;
- yy = hge(h, he, 0);
+ yy = headerGet(h, he, 0);
fnames.ptr = he->p.ptr;
numFiles = he->c;
he->p.ptr = p.ptr;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/package.c
============================================================================
$ cvs diff -u -r2.192 -r2.193 package.c
--- rpm/lib/package.c 23 Nov 2007 00:29:47 -0000 2.192
+++ rpm/lib/package.c 24 Nov 2007 22:07:28 -0000 2.193
@@ -84,7 +84,6 @@
/*@-mods@*/
rpmRC rpmReadPackageFile(rpmts ts, void * _fd, const char * fn, Header * hdrp)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
HE_t she = memset(alloca(sizeof(*she)), 0, sizeof(*she));
pgpDig dig = rpmtsDig(ts);
@@ -229,7 +228,7 @@
dig->nbytes = 0;
/* Retrieve the tag parameters from the signature header. */
- xx = hge(sigh, she, 0);
+ xx = headerGet(sigh, she, 0);
if (she->p.ptr == NULL) {
rc = RPMRC_FAIL;
goto exit;
@@ -259,7 +258,7 @@
size_t nmagic = 0;
he->tag = RPMTAG_HEADERIMMUTABLE;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
uht = he->t;
uh = he->p.ptr;
uhc = he->c;
@@ -298,7 +297,7 @@
size_t nmagic = 0;
he->tag = RPMTAG_HEADERIMMUTABLE;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
uht = he->t;
uh = he->p.ptr;
uhc = he->c;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/psm.c
============================================================================
$ cvs diff -u -r2.265 -r2.266 psm.c
--- rpm/lib/psm.c 24 Nov 2007 19:46:05 -0000 2.265
+++ rpm/lib/psm.c 24 Nov 2007 22:07:28 -0000 2.266
@@ -58,7 +58,6 @@
int rpmVersionCompare(Header first, Header second)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char * one, * two;
uint32_t Eone, Etwo;
@@ -66,11 +65,11 @@
int xx;
he->tag = RPMTAG_EPOCH;
- xx = hge(first, he, 0);
+ xx = headerGet(first, he, 0);
Eone = (xx && he->p.ui32p ? he->p.ui32p[0] : 0);
he->p.ptr = _free(he->p.ptr);
he->tag = RPMTAG_EPOCH;
- xx = hge(second, he, 0);
+ xx = headerGet(second, he, 0);
Etwo = (xx && he->p.ui32p ? he->p.ui32p[0] : 0);
he->p.ptr = _free(he->p.ptr);
@@ -80,10 +79,10 @@
return 1;
he->tag = RPMTAG_VERSION;
- xx = hge(first, he, 0);
+ xx = headerGet(first, he, 0);
one = he->p.str;
he->tag = RPMTAG_VERSION;
- xx = hge(second, he, 0);
+ xx = headerGet(second, he, 0);
two = he->p.str;
rc = rpmvercmp(one, two);
one = _free(one);
@@ -92,10 +91,10 @@
return rc;
he->tag = RPMTAG_RELEASE;
- xx = hge(first, he, 0);
+ xx = headerGet(first, he, 0);
one = he->p.str;
he->tag = RPMTAG_RELEASE;
- xx = hge(second, he, 0);
+ xx = headerGet(second, he, 0);
two = he->p.str;
rc = rpmvercmp(one, two);
one = _free(one);
@@ -187,7 +186,6 @@
rpmRC rpmInstallSourcePackage(rpmts ts, void * _fd,
const char ** specFilePtr, const char ** cookie)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
FD_t fd = _fd;
int scareMem = 0;
@@ -265,7 +263,7 @@
if (cookie) {
*cookie = NULL;
he->tag = RPMTAG_COOKIE;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
*cookie = he->p.str;
}
@@ -285,7 +283,7 @@
if (fi->h != NULL) { /* XXX can't happen */
he->tag = RPMTAG_FILEPATHS;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
fi->apath = he->p.argv;
if (headerIsEntry(fi->h, RPMTAG_COOKIE))
@@ -494,7 +492,6 @@
/*@globals h_errno, fileSystem, internalState @*/
/*@modifies psm, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const rpmts ts = psm->ts;
int rootFdno = -1;
@@ -511,7 +508,7 @@
*ssp |= (RPMSCRIPT_STATE_LUA|RPMSCRIPT_STATE_EXEC);
he->tag = RPMTAG_NVRA;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
assert(he->p.str != NULL);
/* Save the current working directory. */
@@ -627,7 +624,6 @@
/*@modifies psm, ldconfig_done, rpmGlobalMacroContext,
fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const rpmts ts = psm->ts;
const char ** argv = NULL;
@@ -655,7 +651,7 @@
return RPMRC_OK;
he->tag = RPMTAG_NVRA;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
assert(he->p.str != NULL);
NVRA = he->p.str;
@@ -705,13 +701,13 @@
}
he->tag = RPMTAG_INSTPREFIXES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
prefixes = he->p.argv;
numPrefixes = he->c;
if (!xx) {
he->p.ptr = _free(he->p.ptr);
he->tag = RPMTAG_INSTALLPREFIX;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (xx) {
char * t;
prefixes = xmalloc(sizeof(*prefixes) + strlen(he->p.argv[0]) + 1);
@@ -954,7 +950,6 @@
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmfi fi = psm->fi;
const char * argv0 = NULL;
@@ -964,12 +959,12 @@
assert(fi->h != NULL);
he->tag = psm->scriptTag;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
script = he->p.str;
if (script == NULL)
goto exit;
he->tag = psm->progTag;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
if (he->p.ptr == NULL)
goto exit;
@@ -1016,7 +1011,6 @@
rpmGlobalMacroContext, fileSystem, internalState @*/
{
int scareMem = 0;
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const rpmts ts = psm->ts;
rpmds trigger = NULL;
@@ -1030,10 +1024,10 @@
int i;
he->tag = RPMTAG_NAME;
- xx = hge(sourceH, he, 0);
+ xx = headerGet(sourceH, he, 0);
sourceName = he->p.str;
he->tag = RPMTAG_NAME;
- xx = hge(triggeredH, he, 0);
+ xx = headerGet(triggeredH, he, 0);
triggerName = he->p.str;
trigger = rpmdsInit(rpmdsNew(triggeredH, RPMTAG_TRIGGERNAME, scareMem));
@@ -1061,13 +1055,13 @@
continue;
he->tag = RPMTAG_TRIGGERINDEX;
- xx = hge(triggeredH, he, 0);
+ xx = headerGet(triggeredH, he, 0);
triggerIndices = he->p.ui32p;
he->tag = RPMTAG_TRIGGERSCRIPTS;
- xx = hge(triggeredH, he, 0);
+ xx = headerGet(triggeredH, he, 0);
triggerScripts = he->p.argv;
he->tag = RPMTAG_TRIGGERSCRIPTPROG;
- xx = hge(triggeredH, he, 0);
+ xx = headerGet(triggeredH, he, 0);
triggerProgs = he->p.argv;
if (triggerIndices && triggerScripts && triggerProgs) {
@@ -1166,7 +1160,6 @@
/*@modifies psm, rpmGlobalMacroContext,
fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const rpmts ts = psm->ts;
rpmfi fi = psm->fi;
@@ -1183,11 +1176,11 @@
if (fi->h == NULL) return rc; /* XXX can't happen */
he->tag = RPMTAG_TRIGGERNAME;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
triggerNames = he->p.argv;
numTriggers = he->c;
he->tag = RPMTAG_TRIGGERINDEX;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
triggerIndices = he->p.ui32p;
numTriggerIndices = he->c;
@@ -1350,13 +1343,12 @@
static uint32_t hLoadTID(Header h, rpmTag tag)
/*@*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
uint32_t val;
int xx;
he->tag = tag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
val = (xx && he->p.ui32p ? he->p.ui32p[0] : 0);
he->p.ptr = _free(he->p.ptr);
return val;
@@ -1372,13 +1364,12 @@
static int hCopyTag(Header sh, Header th, rpmTag tag)
/*@modifies th @*/
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
int xx = 1;
he->tag = tag;
- if (hge(sh, he, 0) && he->c > 0)
+ if (headerGet(sh, he, 0) && he->c > 0)
xx = hae(th, he, 0);
he->p.ptr = _free(he->p.ptr);
return 0;
@@ -1600,7 +1591,6 @@
/*@-nullpass@*/ /* FIX: testing null annotation for fi->h */
rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage)
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const rpmts ts = psm->ts;
@@ -1698,7 +1688,7 @@
* need the leading / stripped.
*/
he->tag = RPMTAG_DEFAULTPREFIX;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
fi->striplen = (xx && he->p.str ? strlen(he->p.str) + 1 : 1);
he->p.ptr = _free(he->p.ptr);
fi->mapflags =
@@ -1708,18 +1698,18 @@
he->tag = RPMTAG_ORIGPATHS;
else
he->tag = RPMTAG_FILEPATHS;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
assert(he->p.argv != NULL);
fi->apath = he->p.argv;
if (fi->fuser == NULL) {
he->tag = RPMTAG_FILEUSERNAME;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
fi->fuser = he->p.argv;
}
if (fi->fgroup == NULL) {
he->tag = RPMTAG_FILEGROUPNAME;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
fi->fgroup = he->p.argv;
}
rc = RPMRC_OK;
@@ -1846,19 +1836,19 @@
/* Save original header's origin (i.e. URL) */
he->tag = RPMTAG_PACKAGEORIGIN;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
origin = he->p.str;
/* Retrieve original header blob. */
he->tag = RPMTAG_HEADERIMMUTABLE;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
uh = he->p.ptr;
if (xx && uh != NULL) {
psm->oh = headerCopyLoad(uh);
uh = _free(uh);
} else {
he->tag = RPMTAG_HEADERIMAGE;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
uh = he->p.ptr;
if (xx && uh != NULL) {
HeaderIterator hi;
@@ -2347,7 +2337,7 @@
char * t;
he->tag = RPMTAG_PAYLOADCOMPRESSOR;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
payload_compressor = he->p.str;
if (payload_compressor == NULL)
payload_compressor = xstrdup("gzip");
@@ -2364,7 +2354,7 @@
payload_compressor = _free(payload_compressor);
he->tag = RPMTAG_PAYLOADFORMAT;
- xx = hge(fi->h, he, 0);
+ xx = headerGet(fi->h, he, 0);
payload_format = he->p.str;
if (!xx || payload_format == NULL
|| !(!strcmp(payload_format, "tar") || !strcmp(payload_format, "ustar"))) {
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmchecksig.c
============================================================================
$ cvs diff -u -r1.197 -r1.198 rpmchecksig.c
--- rpm/lib/rpmchecksig.c 24 Nov 2007 19:46:05 -0000 1.197
+++ rpm/lib/rpmchecksig.c 24 Nov 2007 22:07:28 -0000 1.198
@@ -145,13 +145,12 @@
/*@globals fileSystem, internalState @*/
/*@modifies *signid, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
int rc = 1;
int xx;
he->tag = sigtag;
- xx = hge(sigh, he, 0);
+ xx = headerGet(sigh, he, 0);
if (xx && he->p.ptr != NULL) {
pgpDig dig = pgpDigNew(0);
@@ -180,7 +179,6 @@
/*@modifies ts, rpmGlobalMacroContext,
fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HRE_t hre = headerRemoveExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
@@ -268,7 +266,7 @@
/* Lose the immutable region (if present). */
he->tag = RPMTAG_HEADERSIGNATURES;
- xx = hge(sigh, he, 0);
+ xx = headerGet(sigh, he, 0);
if (xx) {
HE_t ohe = memset(alloca(sizeof(*ohe)), 0, sizeof(*ohe));
HeaderIterator hi;
@@ -782,7 +780,6 @@
{
rpmxar xar = fdGetXAR(fd);
pgpDig dig = fdGetDig(fd);
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
unsigned char buf[4*BUFSIZ];
ssize_t count;
@@ -811,7 +808,7 @@
size_t nmagic = 0;
he->tag = RPMTAG_HEADERIMMUTABLE;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (!xx || he->p.ptr == NULL) {
h = headerFree(h);
rpmlog(RPMLOG_ERR, _("%s: headerGetEntry failed\n"), fn);
@@ -886,7 +883,6 @@
int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd,
const char * fn)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
HE_t she = memset(alloca(sizeof(*she)), 0, sizeof(*she));
int res2, res3;
@@ -968,7 +964,7 @@
/* XXX RSA needs the hash_algo, so decode early. */
if (she->tag == RPMSIGTAG_RSA) {
he->tag = she->tag;
- xx = hge(sigh, he, 0);
+ xx = headerGet(sigh, he, 0);
xx = pgpPrtPkts(he->p.ptr, he->c, dig, 0);
he->p.ptr = _free(he->p.ptr);
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmds.c
============================================================================
$ cvs diff -u -r2.83 -r2.84 rpmds.c
--- rpm/lib/rpmds.c 22 Nov 2007 22:28:14 -0000 2.83
+++ rpm/lib/rpmds.c 24 Nov 2007 22:07:28 -0000 2.84
@@ -237,7 +237,6 @@
rpmds rpmdsNew(Header h, rpmTag tagN, int flags)
{
int scareMem = (flags & 0x1);
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmTag tagEVR, tagF;
@@ -286,7 +285,7 @@
goto exit;
he->tag = tagN;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
N = he->p.argv;
Count = he->c;
if (xx && N != NULL && Count > 0) {
@@ -302,22 +301,22 @@
if (tagEVR > 0) {
he->tag = tagEVR;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
ds->EVR = he->p.argv;
}
if (tagF > 0) {
he->tag = tagF;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
ds->Flags = he->p.ui32p;
}
{
he->tag = RPMTAG_ARCH;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
ds->A = he->p.str;
}
{
he->tag = RPMTAG_BUILDTIME;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
ds->BT = (he->p.ui32p ? he->p.ui32p[0] : 0);
he->p.ptr = _free(he->p.ptr);
}
@@ -474,7 +473,6 @@
rpmds rpmdsThis(Header h, rpmTag tagN, evrFlags Flags)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmds ds = NULL;
const char * Type;
@@ -508,7 +506,7 @@
goto exit;
he->tag = RPMTAG_EPOCH;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
E = (he->p.ui32p ? he->p.ui32p[0] : 0);
he->p.ptr = _free(he->p.ptr);
@@ -541,11 +539,11 @@
ds->Flags = xmalloc(sizeof(*ds->Flags)); ds->Flags[0] = Flags;
he->tag = RPMTAG_ARCH;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
ds->A = he->p.str;
he->tag = RPMTAG_BUILDTIME;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
ds->BT = (he->p.ui32p ? he->p.ui32p[0] : 0);
he->p.ptr = _free(he->p.ptr);
@@ -3710,7 +3708,6 @@
int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char * pkgN, * V, * R;
uint32_t E;
@@ -3736,7 +3733,7 @@
(void) headerNEVRA(h, &pkgN, NULL, &V, &R, NULL);
/*@=mods@*/
he->tag = RPMTAG_EPOCH;
- gotE = hge(h, he, 0);
+ gotE = headerGet(h, he, 0);
E = (he->p.ui32p ? he->p.ui32p[0] : 0);
he->p.ptr = _free(he->p.ptr);
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmfc.c
============================================================================
$ cvs diff -u -r1.40 -r1.41 rpmfc.c
--- rpm/lib/rpmfc.c 22 Nov 2007 22:28:14 -0000 1.40
+++ rpm/lib/rpmfc.c 24 Nov 2007 22:07:28 -0000 1.41
@@ -1325,7 +1325,6 @@
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
StringBuf sb_stdin = newStringBuf();
StringBuf sb_stdout = NULL;
@@ -1343,7 +1342,7 @@
/* Retrieve scriptlet interpreter. */
he->tag = dm->ntag;
- xx = hge(pkg->header, he, 0);
+ xx = headerGet(pkg->header, he, 0);
if (!xx || he->p.str == NULL)
continue;
xx = strcmp(he->p.str, "/bin/sh") && strcmp(he->p.str, "/bin/bash");
@@ -1353,7 +1352,7 @@
/* Retrieve scriptlet body. */
he->tag = dm->vtag;
- xx = hge(pkg->header, he, 0);
+ xx = headerGet(pkg->header, he, 0);
if (!xx || he->p.str == NULL)
continue;
truncStringBuf(sb_stdin);
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmfi.c
============================================================================
$ cvs diff -u -r2.102 -r2.103 rpmfi.c
--- rpm/lib/rpmfi.c 24 Nov 2007 19:46:05 -0000 2.102
+++ rpm/lib/rpmfi.c 24 Nov 2007 22:07:28 -0000 2.103
@@ -687,7 +687,6 @@
/*@modifies ts, fi, origH, actions, rpmGlobalMacroContext,
internalState @*/
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HME_t hme = headerModifyExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
@@ -721,7 +720,7 @@
int xx;
he->tag = RPMTAG_PREFIXES;
- xx = hge(origH, he, 0);
+ xx = headerGet(origH, he, 0);
validType = he->t;
validRelocations = he->p.argv;
numValid = he->c;
@@ -884,24 +883,24 @@
}
he->tag = RPMTAG_BASENAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
baseNames = he->p.argv;
fileCount = he->c;
he->tag = RPMTAG_DIRINDEXES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
dirIndexes = he->p.ui32p;
he->tag = RPMTAG_DIRNAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
dirNames = he->p.argv;
dirCount = he->c;
he->tag = RPMTAG_FILEFLAGS;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fFlags = he->p.ui32p;
he->tag = RPMTAG_FILECOLORS;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fColors = he->p.ui32p;
he->tag = RPMTAG_FILEMODES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fModes = he->p.ui16p;
dColors = alloca(dirCount * sizeof(*dColors));
@@ -1103,19 +1102,19 @@
/* Save original filenames in header and replace (relocated) filenames. */
if (nrelocated) {
he->tag = RPMTAG_BASENAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
he->tag = RPMTAG_ORIGBASENAMES;
xx = hae(h, he, 0);
he->p.ptr = _free(he->p.ptr);
he->tag = RPMTAG_DIRNAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
he->tag = RPMTAG_ORIGDIRNAMES;
xx = hae(h, he, 0);
he->p.ptr = _free(he->p.ptr);
he->tag = RPMTAG_DIRINDEXES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
he->tag = RPMTAG_ORIGDIRINDEXES;
xx = hae(h, he, 0);
he->p.ptr = _free(he->p.ptr);
@@ -1126,7 +1125,7 @@
he->c = fileCount;
xx = hme(h, he, 0);
fi->bnl = _free(fi->bnl);
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fi->bnl = he->p.argv;
fi->fc = he->c;
@@ -1136,7 +1135,7 @@
he->c = dirCount;
xx = hme(h, he, 0);
fi->dnl = _free(fi->dnl);
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fi->dnl = he->p.argv;
fi->dc = he->c;
@@ -1146,7 +1145,7 @@
he->c = fileCount;
xx = hme(h, he, 0);
fi->dil = _free(fi->dil);
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fi->dil = he->p.ui32p;
}
@@ -1265,18 +1264,17 @@
#define _fdupestring(_h, _tag, _data) \
he->tag = _tag; \
- xx = hge((_h), he, 0); \
+ xx = headerGet((_h), he, 0); \
_data = he->p.str;
#define _fdupedata(_h, _tag, _data) \
he->tag = _tag; \
- xx = hge((_h), he, 0); \
+ xx = headerGet((_h), he, 0); \
_data = he->p.ptr;
rpmfi rpmfiNew(const rpmts ts, Header h, rpmTag tagN, int flags)
{
int scareMem = (flags & 0x1);
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmte p;
rpmfi fi = NULL;
@@ -1316,7 +1314,7 @@
/* 0 means unknown */
he->tag = RPMTAG_ARCHIVESIZE;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fi->archivePos = 0;
fi->archiveSize = (xx && he->p.ui32p ? he->p.ui32p[0] : 0);
he->p.ptr = _free(he->p.ptr);
@@ -1330,7 +1328,7 @@
_fdupestring(h, RPMTAG_VERIFYSCRIPTPROG, fi->verifyscriptprog);
he->tag = RPMTAG_BASENAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fi->bnl = he->p.argv;
fi->fc = he->c;
if (!xx) {
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpminstall.c
============================================================================
$ cvs diff -u -r1.184 -r1.185 rpminstall.c
--- rpm/lib/rpminstall.c 24 Nov 2007 19:46:05 -0000 1.184
+++ rpm/lib/rpminstall.c 24 Nov 2007 22:07:28 -0000 1.185
@@ -309,7 +309,6 @@
/** @todo Generalize --freshen policies. */
int rpmcliInstall(rpmts ts, QVA_t ia, const char ** argv)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
ARGV_t avfn = NULL;
int acfn = 0;
@@ -424,14 +423,14 @@
/* === Check for relocatable package. */
if (relocations) {
he->tag = RPMTAG_PREFIXES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (xx && he->c == 1) {
relocations->oldPath = xstrdup(he->p.argv[0]);
he->p.ptr = _free(he->p.ptr);
} else {
he->p.ptr = _free(he->p.ptr);
he->tag = RPMTAG_NVRA;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
rpmlog(RPMLOG_ERR,
_("package %s is not relocatable\n"), he->p.str);
he->p.ptr = _free(he->p.ptr);
@@ -448,7 +447,7 @@
int count;
he->tag = RPMTAG_NAME;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
assert(xx != 0 && he->p.str != NULL);
mi = rpmtsInitIterator(ts, RPMTAG_NAME, he->p.str, 0);
he->p.ptr = _free(he->p.ptr);
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmrollback.c
============================================================================
$ cvs diff -u -r1.26 -r1.27 rpmrollback.c
--- rpm/lib/rpmrollback.c 22 Nov 2007 22:28:14 -0000 1.26
+++ rpm/lib/rpmrollback.c 24 Nov 2007 22:07:28 -0000 1.27
@@ -91,7 +91,6 @@
IDTX IDTXload(rpmts ts, rpmTag tag, uint32_t rbtid)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
IDTX idtx = NULL;
rpmdbMatchIterator mi;
@@ -105,7 +104,7 @@
#endif
while ((h = rpmdbNextIterator(mi)) != NULL) {
he->tag = tag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (!xx || he->p.ui32p == NULL)
continue;
tid = (he->p.ui32p ? he->p.ui32p[0] : 0);
@@ -141,7 +140,6 @@
IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag, uint32_t rbtid)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
IDTX idtx = NULL;
Header h;
@@ -193,7 +191,7 @@
assert(!strcmp(av[i], origin));
}
he->tag = tag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (!xx || he->p.ui32p == NULL)
goto bottom;
tid = (he->p.ui32p ? he->p.ui32p[0] : 0);
@@ -287,7 +285,6 @@
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, p, ip, rpmGlobalMacroContext, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
int rc = 0;
int xx;
@@ -308,7 +305,7 @@
int bingo;
he->tag = RPMTAG_BLINKPKGID;
- xx = hge(ip->h, he, 0);
+ xx = headerGet(ip->h, he, 0);
flinkPkgid = he->p.argv;
pn = he->c;
@@ -319,11 +316,11 @@
}
he->tag = RPMTAG_BLINKHDRID;
- xx = hge(ip->h, he, 0);
+ xx = headerGet(ip->h, he, 0);
flinkHdrid = he->p.argv;
hn = he->c;
he->tag = RPMTAG_BLINKNEVRA;
- xx = hge(ip->h, he, 0);
+ xx = headerGet(ip->h, he, 0);
flinkNEVRA = he->p.argv;
nn = he->c;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmte.c
============================================================================
$ cvs diff -u -r2.69 -r2.70 rpmte.c
--- rpm/lib/rpmte.c 22 Nov 2007 22:28:14 -0000 2.69
+++ rpm/lib/rpmte.c 24 Nov 2007 22:07:28 -0000 2.70
@@ -96,12 +96,11 @@
rpmGlobalMacroContext, fileSystem, internalState @*/
{
int scareMem = 0;
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
int xx;
he->tag = RPMTAG_NVRA;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
assert(he->p.str != NULL);
p->NEVR = he->p.str;
p->name = xstrdup(p->NEVR);
@@ -113,11 +112,11 @@
p->db_instance = 0;
he->tag = RPMTAG_HDRID;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
p->hdrid = he->p.str;
he->tag = RPMTAG_PKGID;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (he->p.ui8p != NULL) {
static const char hex[] = "0123456789abcdef";
char * t;
@@ -134,11 +133,11 @@
p->pkgid = NULL;
he->tag = RPMTAG_ARCH;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
p->arch = he->p.str;
he->tag = RPMTAG_OS;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
p->os = he->p.str;
p->isSource =
@@ -148,7 +147,7 @@
p->NEVRA = xstrdup(p->NEVR);
he->tag = RPMTAG_EPOCH;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (he->p.ui32p != NULL) {
p->epoch = xmalloc(20);
sprintf(p->epoch, "%u", he->p.ui32p[0]);
@@ -215,7 +214,6 @@
int dboffset,
alKey pkgKey)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmte p = xcalloc(1, sizeof(*p));
int xx;
@@ -229,7 +227,7 @@
/* XXX 256 is only an estimate of signature header. */
p->pkgFileSize = 96 + 256;
he->tag = RPMTAG_SIGSIZE;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (xx && he->p.ui32p)
p->pkgFileSize += *he->p.ui32p;
he->p.ptr = _free(he->p.ptr);
@@ -597,7 +595,6 @@
int rpmteChain(rpmte p, rpmte q, Header oh, const char * msg)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char * blinkNEVRA = NULL;
const char * blinkPkgid = NULL;
@@ -607,7 +604,7 @@
if (msg == NULL)
msg = "";
he->tag = RPMTAG_NVRA;
- xx = hge(oh, he, 0);
+ xx = headerGet(oh, he, 0);
assert(he->p.str != NULL);
blinkNEVRA = he->p.str;
@@ -617,7 +614,7 @@
* tags appended.
*/
he->tag = RPMTAG_PKGID;
- xx = hge(oh, he, 0);
+ xx = headerGet(oh, he, 0);
if (xx && he->p.ui8p != NULL) {
static const char hex[] = "0123456789abcdef";
char * t;
@@ -634,7 +631,7 @@
blinkPkgid = NULL;
he->tag = RPMTAG_HDRID;
- xx = hge(oh, he, 0);
+ xx = headerGet(oh, he, 0);
blinkHdrid = he->p.str;
/*@-modfilesys@*/
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmts.c
============================================================================
$ cvs diff -u -r2.124 -r2.125 rpmts.c
--- rpm/lib/rpmts.c 24 Nov 2007 19:46:05 -0000 2.124
+++ rpm/lib/rpmts.c 24 Nov 2007 22:07:28 -0000 2.125
@@ -309,7 +309,6 @@
int rpmtsSolve(rpmts ts, rpmds ds, /*@unused@*/ const void * data)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char * errstr;
const char * str = NULL;
@@ -360,7 +359,7 @@
continue;
he->tag = RPMTAG_NAME;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
hnamelen = ((xx && he->p.str) ? strlen(he->p.str) : 0);
he->p.ptr = _free(he->p.ptr);
@@ -370,7 +369,7 @@
/* XXX Prefer the newest build if given alternatives. */
he->tag = RPMTAG_BUILDTIME;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
htime = (xx && he->p.ui32p ? he->p.ui32p[0] : 0);
he->p.ptr = _free(he->p.ptr);
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/transaction.c
============================================================================
$ cvs diff -u -r1.355 -r1.356 transaction.c
--- rpm/lib/transaction.c 22 Nov 2007 22:28:14 -0000 1.355
+++ rpm/lib/transaction.c 24 Nov 2007 22:07:28 -0000 1.356
@@ -88,7 +88,6 @@
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, p, fi, rpmGlobalMacroContext, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char * altNVRA = NULL;
uint32_t tscolor = rpmtsColor(ts);
@@ -109,7 +108,7 @@
&shared->otherPkg, sizeof(shared->otherPkg));
while ((h = rpmdbNextIterator(mi)) != NULL) {
he->tag = RPMTAG_NVRA;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
assert(he->p.str != NULL);
altNVRA = he->p.str;
otherFi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem);
@@ -234,7 +233,6 @@
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, fi, rpmGlobalMacroContext, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
Header h;
const unsigned char * otherStates;
@@ -251,7 +249,7 @@
}
he->tag = RPMTAG_FILESTATES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
otherStates = he->p.ptr;
/* XXX there's an obscure segfault here w/o NULL check ... */
@@ -598,7 +596,6 @@
const rpmte p, const Header h)
/*@modifies ts @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
uint32_t reqFlags = (RPMSENSE_LESS | RPMSENSE_EQUAL);
const char * reqEVR;
@@ -626,7 +623,7 @@
if (rc == 0) {
rpmps ps = rpmtsProblems(ts);
he->tag = RPMTAG_NVRA;
- rc = hge(h, he, 0);
+ rc = headerGet(h, he, 0);
assert(he->p.str != NULL);
rpmpsAppend(ps, RPMPROB_OLDPACKAGE,
rpmteNEVR(p), rpmteKey(p),
@@ .
patch -p0 <<'@@ .'
Index: rpm/python/header-py.c
============================================================================
$ cvs diff -u -r1.83 -r1.84 header-py.c
--- rpm/python/header-py.c 24 Nov 2007 19:46:06 -0000 1.83
+++ rpm/python/header-py.c 24 Nov 2007 22:07:30 -0000 1.84
@@ -367,7 +367,6 @@
static PyObject * hdr_subscript(hdrObject * s, PyObject * item)
/*@*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
uint32_t tag = 0xffffffff;
int i;
@@ -408,7 +407,7 @@
}
he->tag = tag;
- xx = hge(s->h, he, 0);
+ xx = headerGet(s->h, he, 0);
if (!xx) {
he->p.ptr = _free(he->p.ptr);
switch (tag) {
@@ -779,7 +778,6 @@
*/
int rpmMergeHeaders(PyObject * list, FD_t fd, int matchTag)
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HRE_t hre = headerRemoveExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
@@ -803,7 +801,7 @@
while (h) {
he->tag = matchTag;
- xx = hge(hdr->h, he, 0);
+ xx = headerGet(hdr->h, he, 0);
newMatch.ptr = he->p.ptr;
if (!xx) {
PyErr_SetString(pyrpmError, "match tag missing in new header");
@@ -817,7 +815,7 @@
}
he->tag = matchTag;
- xx = hge(hdr->h, he, 0);
+ xx = headerGet(hdr->h, he, 0);
oldMatch.ptr = he->p.ptr;
if (!xx) {
PyErr_SetString(pyrpmError, "match tag missing in old header");
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/fprint.c
============================================================================
$ cvs diff -u -r1.22 -r1.23 fprint.c
--- rpm/rpmdb/fprint.c 14 Nov 2007 23:56:33 -0000 1.22
+++ rpm/rpmdb/fprint.c 24 Nov 2007 22:07:30 -0000 1.23
@@ -4,8 +4,8 @@
#include "system.h"
-#include <rpmdb.h>
#include <rpmmacro.h> /* XXX for rpmCleanPath */
+#include <rpmdb.h>
#include "fprint.h"
#include "debug.h"
@@ -248,7 +248,6 @@
void fpLookupHeader(fingerPrintCache cache, Header h, fingerPrint * fpList)
/*@modifies h, cache, *fpList @*/;
{
- HGE_t hge = headerGetExtension;
rpmTagData he_p = { .ptr = NULL };
HE_s he_s = { .tag = 0, .t = 0, .p = &he_p, .c = 0, .freeData = 0 };
HE_t he = &he_s;
@@ -259,17 +258,17 @@
int xx;
he->tag = RPMTAG_BASENAMES;
- xx = hge(h, he->tag, &he->t, he->p, &he->c);
+ xx = headerGet(h, he->tag, &he->t, he->p, &he->c);
baseNames = he_p.argv;
fileCount = he->c;
if (!xx)
return;
he->tag = RPMTAG_DIRNAMES;
- xx = hge(h, he->tag, &he->t, he->p, &he->c);
+ xx = headerGet(h, he, 0);
dirNames = he_p.argv;
he->tag = RPMTAG_DIRINDEXES;
- xx = hge(h, he->tag, &he->t, he->p, &he->c);
+ xx = headerGet(h, he, 0);
dirIndexes = he_p.ui32p;
fpLookupList(cache, dirNames, baseNames, dirIndexes, fileCount, fpList);
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/hdrNVR.c
============================================================================
$ cvs diff -u -r1.36 -r1.37 hdrNVR.c
--- rpm/rpmdb/hdrNVR.c 24 Nov 2007 17:18:58 -0000 1.36
+++ rpm/rpmdb/hdrNVR.c 24 Nov 2007 22:07:30 -0000 1.37
@@ -35,7 +35,6 @@
/*@globals rpmGlobalMacroContext @*/
/*@modifies rpmGlobalMacroContext @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
struct tagMacro * tagm;
char numbuf[64];
@@ -58,7 +57,7 @@
for (tagm = tagMacros; tagm->macroname != NULL; tagm++) {
he->tag = tagm->tag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (!xx)
continue;
val = NULL;
@@ -108,14 +107,13 @@
/*@globals rpmGlobalMacroContext @*/
/*@modifies rpmGlobalMacroContext @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
struct tagMacro * tagm;
int xx;
for (tagm = tagMacros; tagm->macroname != NULL; tagm++) {
he->tag = tagm->tag;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (!xx)
continue;
switch (he->t) {
@@ -204,13 +202,12 @@
uint32_t hGetColor(Header h)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
uint32_t hcolor = 0;
int xx;
he->tag = RPMTAG_FILECOLORS;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (xx && he->p.ptr != NULL && he->c > 0) {
unsigned i;
for (i = 0; i < (unsigned) he->c; i++)
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/hdrfmt.c
============================================================================
$ cvs diff -u -r1.41 -r1.42 hdrfmt.c
--- rpm/rpmdb/hdrfmt.c 24 Nov 2007 21:01:45 -0000 1.41
+++ rpm/rpmdb/hdrfmt.c 24 Nov 2007 22:07:30 -0000 1.42
@@ -1707,8 +1707,6 @@
#define PARSER_IN_EXPR 2
/*@unchecked@*/
-static int _usehge = 1; /* XXX Use headerGetExtension? */
-/*@unchecked@*/
int _tagcache = 1; /* XXX Cache tag data persistently? */
/** \ingroup header
@@ -2529,15 +2527,9 @@
xx = getExtension(hsa, tag->ext, he, hsa->ec + tag->extNum);
} else {
he->tag = tag->tagno; /* XXX necessary? */
- if (_usehge) {
- xx = headerGetExtension(hsa->h, he, 0);
- if (xx) /* XXX 1 on success */
- he->freeData = 1;
- } else {
- xx = headerGetEntry(hsa->h, he->tag, &he->t, &he->p, &he->c);
- if (xx) /* XXX 1 on success */
- he = rpmheMark(he);
- }
+ xx = headerGet(hsa->h, he, 0);
+ if (xx) /* XXX 1 on success */
+ he->freeData = 1;
xx = (xx == 0); /* XXX invert headerGetEntry return. */
}
if (xx) {
@@ -2742,16 +2734,10 @@
if (tag->ext)
xx = getExtension(hsa, tag->ext, he, hsa->ec + tag->extNum);
else {
- if (_usehge) {
- xx = headerGetExtension(hsa->h, he, 0);
- if (xx)
- he->freeData = 1;
- } else {
- xx = headerGetEntry(hsa->h, he->tag, &he->t, &he->p, &he->c);
- if (xx) /* XXX 1 on success */
- he = rpmheMark(he);
- }
- xx = (xx == 0); /* XXX invert headerGetEntry return. */
+ xx = headerGet(hsa->h, he, 0);
+ if (xx)
+ he->freeData = 1;
+ xx = (xx == 0); /* XXX invert headerGet return. */
}
if (xx) {
(void) rpmheClean(he);
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/hdrinline.h
============================================================================
$ cvs diff -u -r1.40 -r1.41 hdrinline.h
--- rpm/rpmdb/hdrinline.h 24 Nov 2007 21:01:45 -0000 1.40
+++ rpm/rpmdb/hdrinline.h 24 Nov 2007 22:07:30 -0000 1.41
@@ -223,34 +223,6 @@
return (h2hv(h)->hdrfreetag) (h, data, type);
}
-void tagTypeValidate(HE_t he)
- /*@globals fileSystem @*/
- /*@modifies fileSystem @*/;
-
-/*
- * Retrieve extension or tag value.
- *
- * @param h header
- * @param he tag container
- * @param flags (unused)
- * @return 1 on success, 0 on failure
- */
-/*@unused@*/ static inline
-int headerGetExtension(Header h, HE_t he, /*@unused@*/ unsigned int flags)
- /*@modifies *he @*/
-{
- int xx;
- if (h == NULL) return 0;
- xx = (h2hv(h)->hdrext) (h, he->tag, &he->t, &he->p, &he->c);
-#if defined(SUPPORT_IMPLICIT_TAG_DATA_TYPES)
-/*@-modfilesys@*/
- /* XXX verify that explicit and implicit types are identical. */
- if (xx) tagTypeValidate(he);
-/*@=modfilesys@*/
-#endif
- return xx;
-}
-
/** \ingroup header
* Add or append tag container to header.
*
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/header.c
============================================================================
$ cvs diff -u -r1.133 -r1.134 header.c
--- rpm/rpmdb/header.c 24 Nov 2007 21:01:45 -0000 1.133
+++ rpm/rpmdb/header.c 24 Nov 2007 22:07:30 -0000 1.134
@@ -1671,108 +1671,6 @@
}
/** \ingroup header
- * Retrieve extension or tag value.
- *
- * @param h header
- * @param tag tag
- * @retval *type tag value data type (or NULL)
- * @retval *p tag value(s) (or NULL)
- * @retval *c number of values (or NULL)
- * @return 1 on success, 0 on failure
- */
-static
-int headerGetExtension(Header h, rpmTag tag,
- /*@null@*/ /*@out@*/ rpmTagType * type,
- /*@null@*/ /*@out@*/ rpmTagData * p,
- /*@null@*/ /*@out@*/ rpmTagCount * c)
- /*@globals headerCompoundFormats @*/
- /*@modifies *type, *p, *c @*/
- /*@requires maxSet(type) >= 0 /\ maxSet(p) >= 0 /\ maxSet(c) >= 0 @*/
-{
- void * sw;
- const char * name = tagName(tag);
- headerSprintfExtension exts = headerCompoundFormats;
- headerSprintfExtension ext;
- HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
- size_t nb = 0;
- int extNum;
- int rc;
-
- if ((sw = headerGetStats(h, 19)) != NULL) /* RPMTS_OP_HDRGET */
- (void) rpmswEnter(sw, 0);
-
- he->tag = tag;
-
- /* Search extensions for specific tag override. */
- for (ext = exts, extNum = 0; ext != NULL && ext->type != HEADER_EXT_LAST;
- ext = (ext->type == HEADER_EXT_MORE ? *ext->u.more : ext+1), extNum++)
- {
- if (ext->name == NULL || ext->type != HEADER_EXT_TAG)
- continue;
- if (!xstrcasecmp(ext->name + (sizeof("RPMTAG_")-1), name))
- break;
- }
-
- if (ext && ext->name != NULL && ext->type == HEADER_EXT_TAG)
- rc = ext->u.tagFunction(h, he);
- else
- rc = intGetEntry(h, he->tag, &he->t, &he->p, &he->c, 0);
-
- if (!rc)
- goto exit;
-
- switch (he->t) {
- default:
-assert(0); /* XXX stop unimplemented oversights. */
- break;
- case RPM_BIN_TYPE:
- he->freeData = 1; /* XXX RPM_BIN_TYPE is malloc'd */
- /*@fallthrough@*/
- case RPM_UINT8_TYPE:
- nb = he->c * sizeof(*he->p.ui8p);
- break;
- case RPM_UINT16_TYPE:
- nb = he->c * sizeof(*he->p.ui16p);
- break;
- case RPM_UINT32_TYPE:
- nb = he->c * sizeof(*he->p.ui32p);
- break;
- case RPM_UINT64_TYPE:
- nb = he->c * sizeof(*he->p.ui64p);
- break;
- case RPM_I18NSTRING_TYPE:
-assert(he->c == 1); /* XXX stop unimplemented oversights. */
- /*@fallthrough@*/
- case RPM_STRING_TYPE:
- if (he->p.str)
- nb = strlen(he->p.str) + 1;
- else
- rc = 0;
- break;
- case RPM_STRING_ARRAY_TYPE:
- break;
- }
-
- /* Allocate all returned storage (if not already). */
- if (p && nb && !he->freeData) {
- void * ptr = memcpy(xmalloc(nb), he->p.ptr, nb);
- he->p.ptr = ptr;
- }
-
-exit:
- if (type)
- *type = he->t;
- if (p)
- p->ptr = he->p.ptr;
- if (c)
- *c = he->c;
-
- if (sw != NULL) (void) rpmswExit(sw, 0);
-
- return rc;
-}
-
-/** \ingroup header
* Retrieve tag value.
* Will never return RPM_I18NSTRING_TYPE! RPM_STRING_TYPE elements with
* RPM_I18NSTRING_TYPE equivalent entries are translated (if HEADER_I18NTABLE
@@ -2360,7 +2258,6 @@
headerCopyLoad,
headerIsEntry,
headerFreeTag,
- headerGetExtension,
headerGetEntry,
headerAddEntry,
headerAppendEntry,
@@ -2387,3 +2284,81 @@
/*@observer@*/ /*@unchecked@*/
HV_t hdrVec = &hdrVec1;
/*@=compmempass =redef@*/
+
+int headerGet(Header h, HE_t he, /*@unused@*/ unsigned int flags)
+{
+ void * sw;
+ const char * name;
+ headerSprintfExtension exts = headerCompoundFormats;
+ headerSprintfExtension ext;
+ size_t nb = 0;
+ int extNum;
+ int rc;
+
+ if (h == NULL || he == NULL) return 0; /* XXX this is nutty. */
+ name = tagName(he->tag);
+
+ if ((sw = headerGetStats(h, 19)) != NULL) /* RPMTS_OP_HDRGET */
+ (void) rpmswEnter(sw, 0);
+
+ /* Search extensions for specific tag override. */
+ for (ext = exts, extNum = 0; ext != NULL && ext->type != HEADER_EXT_LAST;
+ ext = (ext->type == HEADER_EXT_MORE ? *ext->u.more : ext+1), extNum++)
+ {
+ if (ext->name == NULL || ext->type != HEADER_EXT_TAG)
+ continue;
+ if (!xstrcasecmp(ext->name + (sizeof("RPMTAG_")-1), name))
+ break;
+ }
+
+ if (ext && ext->name != NULL && ext->type == HEADER_EXT_TAG)
+ rc = ext->u.tagFunction(h, he);
+ else
+ rc = intGetEntry(h, he->tag, &he->t, &he->p, &he->c, 0);
+
+ if (!rc)
+ goto exit;
+
+ switch (he->t) {
+ default:
+assert(0); /* XXX stop unimplemented oversights. */
+ break;
+ case RPM_BIN_TYPE:
+ he->freeData = 1; /* XXX RPM_BIN_TYPE is malloc'd */
+ /*@fallthrough@*/
+ case RPM_UINT8_TYPE:
+ nb = he->c * sizeof(*he->p.ui8p);
+ break;
+ case RPM_UINT16_TYPE:
+ nb = he->c * sizeof(*he->p.ui16p);
+ break;
+ case RPM_UINT32_TYPE:
+ nb = he->c * sizeof(*he->p.ui32p);
+ break;
+ case RPM_UINT64_TYPE:
+ nb = he->c * sizeof(*he->p.ui64p);
+ break;
+ case RPM_I18NSTRING_TYPE:
+assert(he->c == 1); /* XXX stop unimplemented oversights. */
+ /*@fallthrough@*/
+ case RPM_STRING_TYPE:
+ if (he->p.str)
+ nb = strlen(he->p.str) + 1;
+ else
+ rc = 0;
+ break;
+ case RPM_STRING_ARRAY_TYPE:
+ break;
+ }
+
+ /* Allocate all returned storage (if not already). */
+ if (he->p.ptr && nb && !he->freeData) {
+ void * ptr = memcpy(xmalloc(nb), he->p.ptr, nb);
+ he->p.ptr = ptr;
+ }
+
+exit:
+ if (sw != NULL) (void) rpmswExit(sw, 0);
+
+ return rc;
+}
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/header.h
============================================================================
$ cvs diff -u -r1.74 -r1.75 header.h
--- rpm/rpmdb/header.h 24 Nov 2007 21:01:45 -0000 1.74
+++ rpm/rpmdb/header.h 24 Nov 2007 22:07:30 -0000 1.75
@@ -97,17 +97,6 @@
void * (*HFD_t) (/*@only@*/ /*@null@*/ const void * data, rpmTagType type)
/*@modifies data @*/;
-/*
- * Retrieve extension or tag value.
- *
- * @param h header
- * @param he tag container
- * @param flags (unused)
- * @return 1 on success, 0 on failure
- */
-typedef int (*HGE_t) (Header h, HE_t he, unsigned int flags)
- /*@modifies *he @*/;
-
/**
* Add or append tag container to header.
*
@@ -277,23 +266,6 @@
/*@modifies data @*/;
/** \ingroup header
- * Retrieve extension or tag value.
- *
- * @param h header
- * @param tag tag
- * @retval *type tag value data type (or NULL)
- * @retval *p tag value(s) (or NULL)
- * @retval *c number of values (or NULL)
- * @return 1 on success, 0 on failure
- */
-typedef
-int (*HDRext) (Header h, rpmTag tag,
- /*@null@*/ /*@out@*/ rpmTagType * type,
- /*@null@*/ /*@out@*/ rpmTagData * p,
- /*@null@*/ /*@out@*/ rpmTagCount * c)
- /*@modifies *type, *p, *c @*/;
-
-/** \ingroup header
* Retrieve tag value.
* Will never return RPM_I18NSTRING_TYPE! RPM_STRING_TYPE elements with
* RPM_I18NSTRING_TYPE equivalent entries are translated (if HEADER_I18NTABLE
@@ -548,7 +520,6 @@
HDRcopyload hdrcopyload;
HDRisentry hdrisentry;
HDRfreetag hdrfreetag;
- HDRext hdrext;
HDRget hdrget;
HDRadd hdradd;
HDRappend hdrappend;
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/librpmdb.vers
============================================================================
$ cvs diff -u -r1.31 -r1.32 librpmdb.vers
--- rpm/rpmdb/librpmdb.vers 24 Nov 2007 21:01:45 -0000 1.31
+++ rpm/rpmdb/librpmdb.vers 24 Nov 2007 22:07:30 -0000 1.32
@@ -30,6 +30,7 @@
headerCheck;
headerCompoundFormats;
headerDefaultFormats;
+ headerGet;
headerMacrosLoad;
headerMacrosUnload;
headerMergeLegacySigs;
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/pkgio.c
============================================================================
$ cvs diff -u -r1.59 -r1.60 pkgio.c
--- rpm/rpmdb/pkgio.c 24 Nov 2007 17:18:58 -0000 1.59
+++ rpm/rpmdb/pkgio.c 24 Nov 2007 22:07:30 -0000 1.60
@@ -163,7 +163,6 @@
rpmRC rpmtsFindPubkey(rpmts ts, void * _dig)
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
pgpDig dig = (_dig ? _dig : rpmtsDig(ts));
const void * sig = pgpGetSig(dig);
@@ -242,7 +241,7 @@
he->tag = RPMTAG_PUBKEYS;
mi = rpmdbInitIterator(rpmtsGetRdb(ts), RPMTAG_PUBKEYS, sigp->signid, sizeof(sigp->signid));
while ((h = rpmdbNextIterator(mi)) != NULL) {
- if (!hge(h, he, 0))
+ if (!headerGet(h, he, 0))
continue;
hx = rpmdbGetIteratorOffset(mi);
ix = rpmdbGetIteratorFileNum(mi);
@@ -661,7 +660,6 @@
/*@modifies *ptr, *msg, fileSystem @*/
{
rpmxar xar = fdGetXAR(fd);
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
Header * sighp = ptr;
char buf[BUFSIZ];
@@ -842,7 +840,7 @@
/* Print package component sizes. */
he->tag = (rpmTag) RPMSIGTAG_SIZE;
- xx = hge(sigh, he, 0);
+ xx = headerGet(sigh, he, 0);
if (xx) {
size_t datasize = he->p.ui32p[0];
rc = printSize(fd, sigSize, pad, datasize);
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/rpmdb.c
============================================================================
$ cvs diff -u -r1.219 -r1.220 rpmdb.c
--- rpm/rpmdb/rpmdb.c 24 Nov 2007 19:46:07 -0000 1.219
+++ rpm/rpmdb/rpmdb.c 24 Nov 2007 22:07:30 -0000 1.220
@@ -861,7 +861,6 @@
/*@modifies rpmGlobalMacroContext,
fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char * fn = NULL;
int xx;
@@ -882,7 +881,7 @@
xx = Fclose(fd);
fd = NULL;
he->tag = RPMTAG_INSTALLTID;
- if (hge(h, he, 0)) {
+ if (headerGet(h, he, 0)) {
struct utimbuf stamp;
stamp.actime = he->p.ui32p[0];
stamp.modtime = he->p.ui32p[0];
@@ -1407,7 +1406,6 @@
fileSystem, internalState @*/
/*@requires maxSet(matches) >= 0 @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char * dirName;
const char * baseName;
@@ -1508,13 +1506,13 @@
}
he->tag = RPMTAG_BASENAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
baseNames = he->p.argv;
he->tag = RPMTAG_DIRNAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
dirNames = he->p.argv;
he->tag = RPMTAG_DIRINDEXES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
dirIndexes = he->p.ui32p;
do {
@@ -2149,7 +2147,6 @@
static int mireSkip (const rpmdbMatchIterator mi)
/*@modifies mi->mi_re @*/
{
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
char numbuf[32];
miRE mire;
@@ -2173,7 +2170,7 @@
he->tag = mire->tag;
- if (!hge(mi->mi_h, he, 0)) {
+ if (!headerGet(mi->mi_h, he, 0)) {
if (he->tag != RPMTAG_EPOCH) {
ntags++;
continue;
@@ -2795,7 +2792,6 @@
DBT * key = alloca(sizeof(*key));
DBT * data = alloca(sizeof(*data));
union _dbswap mi_offset;
- HGE_t hge = headerGetExtension;
#ifdef DYING
HAE_t hae = headerAddExtension;
#endif
@@ -2839,7 +2835,7 @@
#endif
he->tag = RPMTAG_NVRA;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
rpmlog(RPMLOG_DEBUG, " --- h#%8u %s\n", hdrNum, he->p.str);
he->p.ptr = _free(he->p.ptr);
@@ -2899,7 +2895,7 @@
continue;
/*@notreached@*/ /*@switchbreak@*/ break;
default:
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
if (!xx) {
/* XXX FIXME: headerGetExtension shouldn't malloc. */
he->p.ptr = _free(he->p.ptr);
@@ -3113,7 +3109,6 @@
DBC * dbcursor = NULL;
DBT * key = alloca(sizeof(*key));
DBT * data = alloca(sizeof(*data));
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
#ifdef NOTYET /* XXX headerRemoveEntry() broken on dribbles. */
HRE_t hre = headerRemoveExtension;
@@ -3165,10 +3160,10 @@
}
he->tag = RPMTAG_DIRNAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
dirNames = he->p.argv;
he->tag = RPMTAG_DIRINDEXES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
dirIndexes = he->p.ui32p;
(void) blockSignals(db, &signalMask);
@@ -3336,13 +3331,13 @@
/*@notreached@*/ /*@switchbreak@*/ break;
case RPMTAG_REQUIRENAME:
he->tag = RPMTAG_REQUIREFLAGS;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
requireFlags.ptr = he->p.ptr;
he->tag = RPMTAG_REQUIRENAME;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
/*@switchbreak@*/ break;
default:
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
/*@switchbreak@*/ break;
}
@@ -3570,7 +3565,6 @@
{
DBT * key;
DBT * data;
- HGE_t hge = headerGetExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
rpmdbMatchIterator mi;
fingerPrintCache fpc;
@@ -3639,13 +3633,13 @@
/* Compute fingerprints for this installed header's matches */
he->tag = RPMTAG_BASENAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fullBaseNames = he->p.argv;
he->tag = RPMTAG_DIRNAMES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
dirNames = he->p.argv;
he->tag = RPMTAG_DIRINDEXES;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
fullDirIndexes = he->p.ui32p;
baseNames = xcalloc(num, sizeof(*baseNames));
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/rpmtag.h
============================================================================
$ cvs diff -u -r1.12 -r1.13 rpmtag.h
--- rpm/rpmdb/rpmtag.h 24 Nov 2007 21:01:45 -0000 1.12
+++ rpm/rpmdb/rpmtag.h 24 Nov 2007 22:07:30 -0000 1.13
@@ -650,6 +650,18 @@
/*@modifies h, *errmsg @*/
/*@requires maxSet(errmsg) >= 0 @*/;
+/** \ingroup header
+ * Retrieve extension or tag value from a header.
+ *
+ * @param h header
+ * @param he tag container
+ * @param flags (unused)
+ * @return 1 on success, 0 on failure
+ */
+int headerGet(Header h, HE_t he, unsigned int flags)
+ /*@globals headerCompoundFormats @*/
+ /*@modifies he @*/;
+
#ifdef __cplusplus
}
#endif
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/signature.c
============================================================================
$ cvs diff -u -r1.32 -r1.33 signature.c
--- rpm/rpmdb/signature.c 23 Nov 2007 07:06:01 -0000 1.32
+++ rpm/rpmdb/signature.c 24 Nov 2007 22:07:30 -0000 1.33
@@ -306,7 +306,6 @@
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies sigh, sigTag, rpmGlobalMacroContext, fileSystem, internalState @*/
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
Header h = NULL;
@@ -350,7 +349,7 @@
DIGEST_CTX ctx;
he->tag = RPMTAG_HEADERIMMUTABLE;
- if (!hge(h, he, 0) || he->p.ptr == NULL)
+ if (!headerGet(h, he, 0) || he->p.ptr == NULL)
{
h = headerFree(h);
goto exit;
@@ .
patch -p0 <<'@@ .'
Index: rpm/tools/rpm2cpio.c
============================================================================
$ cvs diff -u -r2.1 -r2.2 rpm2cpio.c
--- rpm/tools/rpm2cpio.c 23 Nov 2007 16:55:42 -0000 2.1
+++ rpm/tools/rpm2cpio.c 24 Nov 2007 22:07:31 -0000 2.2
@@ -65,14 +65,13 @@
}
/* Retrieve type of payload compression. */
- { HGE_t hge = headerGetExtension;
- HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
+ { HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
const char * payload_compressor = NULL;
char * t;
int xx;
he->tag = RPMTAG_PAYLOADCOMPRESSOR;
- xx = hge(h, he, 0);
+ xx = headerGet(h, he, 0);
payload_compressor = (xx ? he->p.str : "gzip");
rpmio_flags = t = alloca(sizeof("r.gzdio"));
@@ .
patch -p0 <<'@@ .'
Index: rpm/tools/rpmcache.c
============================================================================
$ cvs diff -u -r2.24 -r2.25 rpmcache.c
--- rpm/tools/rpmcache.c 22 Nov 2007 22:28:18 -0000 2.24
+++ rpm/tools/rpmcache.c 24 Nov 2007 22:07:31 -0000 2.25
@@ -106,7 +106,6 @@
static int ftsCacheUpdate(rpmts ts)
{
- HGE_t hge = headerGetExtension;
HAE_t hae = headerAddExtension;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
uint32_t tid = rpmtsGetTid(ts);
@@ -133,7 +132,7 @@
/* --- Check that identical package is not already cached. */
he->tag = RPMTAG_SIGMD5;
- xx = hge(ip->h, he, 0);
+ xx = headerGet(ip->h, he, 0);
md5 = he->p.ui8p;
if (!xx || md5 == NULL) {
md5 = _free(md5);
@@ .
Received on Sat Nov 24 23:07:31 2007