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 18:18:59
Branch: HEAD Handle: 2007112417185602
Modified files:
rpm CHANGES TODO
rpm/lib formats.c query.c rpmlib.h rpmte.h
rpm/python header-py.c rpmmodule.c
rpm/rpmdb Makefile.am hdrNVR.c hdrfmt.c header.c
header_internal.c pkgio.c rpmdb.c rpmtag.h rpmwf.c
Log:
- remove signature header padding issue from the TODO.
- fix: --querytags as uint32, not int32, display array return type.
- add level of chaining indirection => opaque headerSprintfExtension_s.
- casts to remove compiler signedness warnings.
Summary:
Revision Changes Path
1.1880 +4 -0 rpm/CHANGES
1.24 +0 -3 rpm/TODO
2.121 +6 -3 rpm/lib/formats.c
2.194 +24 -6 rpm/lib/query.c
2.449 +2 -2 rpm/lib/rpmlib.h
2.40 +1 -1 rpm/lib/rpmte.h
1.82 +3 -2 rpm/python/header-py.c
1.156 +17 -15 rpm/python/rpmmodule.c
1.90 +1 -1 rpm/rpmdb/Makefile.am
1.36 +1 -1 rpm/rpmdb/hdrNVR.c
1.38 +7 -3 rpm/rpmdb/hdrfmt.c
1.130 +11 -8 rpm/rpmdb/header.c
1.18 +1 -0 rpm/rpmdb/header_internal.c
1.59 +6 -5 rpm/rpmdb/pkgio.c
1.218 +4 -4 rpm/rpmdb/rpmdb.c
1.9 +16 -7 rpm/rpmdb/rpmtag.h
1.21 +6 -6 rpm/rpmdb/rpmwf.c
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.1879 -r1.1880 CHANGES
--- rpm/CHANGES 23 Nov 2007 23:52:35 -0000 1.1879
+++ rpm/CHANGES 24 Nov 2007 17:18:56 -0000 1.1880
@@ -1,4 +1,8 @@
5.0a2 -> 5.0a3:
+ - jbj: remove signature header padding issue from the TODO.
+ - jbj: fix: --querytags as uint32, not int32, display array return type.
+ - jbj: add level of chaining indirection => opaque headerSprintfExtension_s.
+ - jbj: casts to remove compiler signedness warnings.
- jbj: display 1st 8 bytes of content for XAR archive members.
- jbj: remove newlines in pkgio messages.
- jbj: fix: padding between signature <-> metadata headers wrong, grr.
@@ .
patch -p0 <<'@@ .'
Index: rpm/TODO
============================================================================
$ cvs diff -u -r1.23 -r1.24 TODO
--- rpm/TODO 23 Nov 2007 00:29:47 -0000 1.23
+++ rpm/TODO 24 Nov 2007 17:18:56 -0000 1.24
@@ -59,9 +59,6 @@
- jbj: markReplacedFiles() subtly rewrites header back into rpmdb
with altered RPMTAG_FILESTATES data. get/del/add sequence
is needed instead.
- - jbj: sign *.rpm, convert to *.xar using txar, DSA verify w my pubkey
- "works", but not same FC8 package converted using txar and FC8 pubkey
- verify.
- jbj: check that rpmbuild --sign is functional, or eliminate the option.
- jbj: parsing error paths (like missing source or patch file) are
returning rpmRC in some cases now, with accidental collision with
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/formats.c
============================================================================
$ cvs diff -u -r2.120 -r2.121 formats.c
--- rpm/lib/formats.c 22 Nov 2007 22:28:14 -0000 2.120
+++ rpm/lib/formats.c 24 Nov 2007 17:18:57 -0000 2.121
@@ -7,6 +7,8 @@
#include <rpmio.h>
#include <rpmcb.h> /* XXX fnpyKey */
#include <rpmmacro.h> /* XXX for %_i18ndomains */
+
+#define _RPMTAG_INTERNAL
#include <header.h>
#include <rpmlib.h>
@@ -21,7 +23,6 @@
#include "debug.h"
-
/**
* Retrieve mounted file system paths.
* @param h header
@@ -262,7 +263,7 @@
}
/*@-type@*/ /* FIX: cast? */
-const struct headerSprintfExtension_s rpmHeaderFormats[] = {
+static struct headerSprintfExtension_s _rpmHeaderFormats[] = {
{ HEADER_EXT_TAG, "RPMTAG_ENHANCES",
{ .tagFunction = missingokTag } },
{ HEADER_EXT_TAG, "RPMTAG_FILECLASS",
@@ -283,6 +284,8 @@
{ .tagFunction = recontextsTag } },
{ HEADER_EXT_TAG, "RPMTAG_SUGGESTS",
{ .tagFunction = missingokTag } },
- { HEADER_EXT_MORE, NULL, { (void *) headerCompoundFormats } }
+ { HEADER_EXT_MORE, NULL, { (void *) &headerCompoundFormats } }
} ;
/*@=type@*/
+
+headerSprintfExtension rpmHeaderFormats = &_rpmHeaderFormats[0];
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/query.c
============================================================================
$ cvs diff -u -r2.193 -r2.194 query.c
--- rpm/lib/query.c 22 Nov 2007 22:28:14 -0000 2.193
+++ rpm/lib/query.c 24 Nov 2007 17:18:57 -0000 2.194
@@ -12,6 +12,7 @@
#endif
#include <rpmio.h>
+#define _RPMTAG_INTERNAL
#include <header.h>
#include <rpmcli.h>
@@ -357,7 +358,7 @@
{
const struct headerTagTableEntry_s * t;
uint32_t ttype;
- headerSprintfExtension exts = (headerSprintfExtension) rpmHeaderFormats;
+ headerSprintfExtension exts = rpmHeaderFormats;
headerSprintfExtension ext;
int extNum;
int i;
@@ -368,20 +369,37 @@
if (rpmIsVerbose()) {
/*@observer@*/
static const char * tagtypes[] = {
- "", "char", "int8", "int16", "int32", "int64",
- "string", "blob", "argv", "i18nstring", "asn1", "openpgp"
+ "", "char", "uint8", "uint16", "uint32", "uint64",
+ "string", "octets", "argv", "i18nstring",
};
fprintf(fp, "%-20s %6d", t->name + 7, t->val);
ttype = t->type & RPM_MASK_TYPE;
- if (ttype >= RPM_MIN_TYPE && ttype <= RPM_MAX_TYPE)
- fprintf(fp, " %s", tagtypes[ttype]);
+ if (ttype < RPM_MIN_TYPE || ttype > RPM_MAX_TYPE)
+ continue;
+ if (t->type & RPM_OPENPGP_RETURN_TYPE)
+ fprintf(fp, " openpgp");
+ if (t->type & RPM_X509_RETURN_TYPE)
+ fprintf(fp, " x509");
+ if (t->type & RPM_ASN1_RETURN_TYPE)
+ fprintf(fp, " asn1");
+ if (t->type & RPM_OPAQUE_RETURN_TYPE)
+ fprintf(fp, " opaque");
+ fprintf(fp, " %s", tagtypes[ttype]);
+ if (t->type & RPM_ARRAY_RETURN_TYPE)
+ fprintf(fp, " array");
+ if (t->type & RPM_MAPPING_RETURN_TYPE)
+ fprintf(fp, " mapping");
+ if (t->type & RPM_PROBE_RETURN_TYPE)
+ fprintf(fp, " probe");
+ if (t->type & RPM_TREE_RETURN_TYPE)
+ fprintf(fp, " tree");
} else
fprintf(fp, "%s", t->name + 7);
fprintf(fp, "\n");
}
for (ext = exts, extNum = 0; ext != NULL && ext->type != HEADER_EXT_LAST;
- ext = (ext->type == HEADER_EXT_MORE ? ext->u.more : ext+1), extNum++)
+ ext = (ext->type == HEADER_EXT_MORE ? *ext->u.more : ext+1), extNum++)
{
if (ext->name == NULL || ext->type != HEADER_EXT_TAG)
continue;
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmlib.h
============================================================================
$ cvs diff -u -r2.448 -r2.449 rpmlib.h
--- rpm/lib/rpmlib.h 19 Nov 2007 18:57:54 -0000 2.448
+++ rpm/lib/rpmlib.h 24 Nov 2007 17:18:57 -0000 2.449
@@ -111,11 +111,11 @@
/**
* Table of query format extensions.
- * @note Chains headerCompoundFormats[] -> headerDefaultFormats[].
+ * @note Chains *headerCompoundFormats -> *headerDefaultFormats.
*/
/*@-redecl@*/
/*@unchecked@*/
-extern const struct headerSprintfExtension_s rpmHeaderFormats[];
+extern headerSprintfExtension rpmHeaderFormats;
/*@=redecl@*/
/**
@@ .
patch -p0 <<'@@ .'
Index: rpm/lib/rpmte.h
============================================================================
$ cvs diff -u -r2.39 -r2.40 rpmte.h
--- rpm/lib/rpmte.h 3 Nov 2007 23:44:01 -0000 2.39
+++ rpm/lib/rpmte.h 24 Nov 2007 17:18:57 -0000 2.40
@@ -682,7 +682,6 @@
if (p->flink.NEVRA) argvPrint("flink.NEVRA", p->flink.NEVRA, NULL);
}
};
-#endif
static inline void hdrPrintInstalled(Header h)
/*@globals fileSystem @*/
@@ -719,6 +718,7 @@
}
}
#endif
+#endif
#ifdef __cplusplus
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/python/header-py.c
============================================================================
$ cvs diff -u -r1.81 -r1.82 header-py.c
--- rpm/python/header-py.c 22 Nov 2007 19:27:14 -0000 1.81
+++ rpm/python/header-py.c 24 Nov 2007 17:18:57 -0000 1.82
@@ -5,10 +5,11 @@
#include "system.h"
#include "rpmio_internal.h"
-#include "rpmcli.h" /* XXX for rpmCheckSig */
#include "legacy.h"
+#define _RPMTAG_INTERNAL
#include "header_internal.h" /* XXX HEADERFLAG_ALLOCATED */
+#include "rpmcli.h" /* XXX for rpmCheckSig */
#include "pkgio.h" /* XXX rpmpkgRead */
#include "rpmts.h" /* XXX rpmtsCreate/rpmtsFree */
@@ -393,7 +394,7 @@
}
extensions++;
if (extensions->type == HEADER_EXT_MORE)
- extensions = extensions->u.more;
+ extensions = *extensions->u.more;
}
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/python/rpmmodule.c
============================================================================
$ cvs diff -u -r1.155 -r1.156 rpmmodule.c
--- rpm/python/rpmmodule.c 3 Nov 2007 15:38:18 -0000 1.155
+++ rpm/python/rpmmodule.c 24 Nov 2007 17:18:57 -0000 1.156
@@ -5,13 +5,14 @@
#include "system.h"
#include <rpmio_internal.h>
-#include <rpmcli.h> /* XXX for rpmCheckSig */
-#include <rpmdb.h>
#include <rpmsq.h>
+#define _RPMTAG_INTERNAL
+#include <rpmtag.h>
+#include <rpmdb.h>
+#include <rpmcli.h> /* XXX for rpmCheckSig */
#include "legacy.h"
#include "misc.h"
-#include "header.h"
#include "header-py.h"
#include "rpmal-py.h"
@@ -238,8 +239,6 @@
{
PyObject * d, *o, * tag = NULL, * dict;
int i;
- const struct headerSprintfExtension_s * extensions = rpmHeaderFormats;
- struct headerSprintfExtension_s * ext;
PyObject * m;
#if Py_TPFLAGS_HAVE_ITER /* XXX backport to python-1.5.2 */
@@ -345,21 +344,24 @@
Py_DECREF(o);
}
- while (extensions->name) {
- if (extensions->type == HEADER_EXT_TAG) {
- ext = extensions;
- PyDict_SetItemString(d, (char *) extensions->name, o=PyCObject_FromVoidPtr(ext, NULL));
- Py_DECREF(o);
- PyDict_SetItem(dict, tag, o=PyString_FromString(ext->name + 7));
- Py_DECREF(o);
- }
- extensions++;
+ { headerSprintfExtension exts = rpmHeaderFormats;
+ headerSprintfExtension ext;
+ int extNum;
+ 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;
+ PyDict_SetItemString(d, (char *) ext->name, o=PyCObject_FromVoidPtr((void *)ext, NULL));
+ Py_DECREF(o);
+ PyDict_SetItem(dict, tag, o=PyString_FromString(ext->name + 7));
+ Py_DECREF(o);
}
+ }
PyDict_SetItemString(d, "tagnames", dict);
Py_DECREF(dict);
-
#define REGISTER_ENUM(val) \
PyDict_SetItemString(d, #val, o=PyInt_FromLong( val )); \
Py_DECREF(o);
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/Makefile.am
============================================================================
$ cvs diff -u -r1.89 -r1.90 Makefile.am
--- rpm/rpmdb/Makefile.am 11 Nov 2007 22:07:46 -0000 1.89
+++ rpm/rpmdb/Makefile.am 24 Nov 2007 17:18:58 -0000 1.90
@@ -86,7 +86,7 @@
@echo '' >> $@
@echo '/*@observer@*/ /*@unchecked@*/' >> $@
@echo 'static const struct headerTagTableEntry_s rpmTagTbl[] = {' >> $@
- ${AWK} '/(RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ {tt = "NULL"; ta = "ANY"; if ($$5 == "c") {tt = "UINT8"; ta = "SCALAR"} if ($$5 == "c[]") {tt = "UINT8"; ta = "ARRAY"} if ($$5 == "h") {tt = "UINT16"; ta = "SCALAR"} if ($$5 == "h[]") {tt = "UINT16"; ta = "ARRAY"} if ($$5 == "i") {tt = "UINT32"; ta = "SCALAR"} if ($$5 == "i[]") {tt = "UINT32"; ta = "ARRAY"} if ($$5 == "l") {tt = "UINT64"; ta = "SCALAR"} if ($$5 == "l[]") {tt = "UINT64"; ta = "ARRAY"} if ($$5 == "s") {tt = "STRING"; ta = "SCALAR"} if ($$5 == "s[]") {tt = "STRING_ARRAY"; ta = "ARRAY"} if ($$5 == "s{}") {tt = "I18NSTRING"; ta = "SCALAR"} if ($$5 == "x") {tt = "BIN"; ta = "SCALAR"} if ($$2 == "=") { printf("\t{ \"%s\", %s RPM_%s_TYPE + RPM_%s_RETURN_TYPE },\n", $$1, $$3, tt, ta) } else { printf("\t{ \"%s\", %s, RPM_%s_TYPE + RPM_%s_RETURN_TYPE },\n", $$2, $$3, tt, ta) } }' < ${top_srcdir}/rpmdb/rpmtag.h | sort >> $@
+ ${AWK} '/[ \t](RPMTAG_[A-Z0-9]*)[ \t]+([0-9]*)/ && !/internal/ {tt = "NULL"; ta = "ANY"; if ($$5 == "c") {tt = "UINT8"; ta = "SCALAR"} if ($$5 == "c[]") {tt = "UINT8"; ta = "ARRAY"} if ($$5 == "h") {tt = "UINT16"; ta = "SCALAR"} if ($$5 == "h[]") {tt = "UINT16"; ta = "ARRAY"} if ($$5 == "i") {tt = "UINT32"; ta = "SCALAR"} if ($$5 == "i[]") {tt = "UINT32"; ta = "ARRAY"} if ($$5 == "l") {tt = "UINT64"; ta = "SCALAR"} if ($$5 == "l[]") {tt = "UINT64"; ta = "ARRAY"} if ($$5 == "s") {tt = "STRING"; ta = "SCALAR"} if ($$5 == "s[]") {tt = "STRING_ARRAY"; ta = "ARRAY"} if ($$5 == "s{}") {tt = "I18NSTRING"; ta = "SCALAR"} if ($$5 == "x") {tt = "BIN"; ta = "SCALAR"} if ($$2 == "=") { printf("\t{ \"%s\", %s RPM_%s_TYPE + RPM_%s_RETURN_TYPE },\n", $$1, $$3, tt, ta) } else { printf("\t{ \"%s\", %s, RPM_%s_TYPE + RPM_%s_RETURN_TYPE },\n", $$2, $$3, tt, ta) } }' < ${top_srcdir}/rpmdb/rpmtag.h | sort >> $@
@echo ' { NULL, 0, 0 }' >> $@
@echo '};' >> $@
@echo '' >> $@
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/hdrNVR.c
============================================================================
$ cvs diff -u -r1.35 -r1.36 hdrNVR.c
--- rpm/rpmdb/hdrNVR.c 23 Nov 2007 07:06:01 -0000 1.35
+++ rpm/rpmdb/hdrNVR.c 24 Nov 2007 17:18:58 -0000 1.36
@@ -3,10 +3,10 @@
*/
#include "system.h"
-#include <rpmtag.h>
#include <rpmio.h>
#include <rpmmacro.h>
+#define _RPMTAG_INTERNAL
#include "header_internal.h" /* XXX hdrchkType(), hdrchkData() */
#include "debug.h"
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/hdrfmt.c
============================================================================
$ cvs diff -u -r1.37 -r1.38 hdrfmt.c
--- rpm/rpmdb/hdrfmt.c 22 Nov 2007 22:28:17 -0000 1.37
+++ rpm/rpmdb/hdrfmt.c 24 Nov 2007 17:18:58 -0000 1.38
@@ -5,9 +5,11 @@
#include "system.h"
#include "rpmio_internal.h"
+#include <rpmmacro.h> /* XXX for %_i18ndomains */
+
+#define _RPMTAG_INTERNAL
#include <header.h>
#include <rpmlib.h> /* XXX RPMFILE_FOO, rpmMkdirPath */
-#include <rpmmacro.h> /* XXX for %_i18ndomains */
#define _RPMEVR_INTERNAL
#include <rpmevr.h> /* XXX RPMSENSE_FOO */
@@ -1335,7 +1337,7 @@
}
/*@-type@*/ /* FIX: cast? */
-const struct headerSprintfExtension_s headerCompoundFormats[] = {
+static struct headerSprintfExtension_s _headerCompoundFormats[] = {
{ HEADER_EXT_TAG, "RPMTAG_CHANGELOGNAME",
{ .tagFunction = changelognameTag } },
{ HEADER_EXT_TAG, "RPMTAG_CHANGELOGTEXT",
@@ -1382,6 +1384,8 @@
{ .fmtFunction = xmlFormat } },
{ HEADER_EXT_FORMAT, "yaml",
{ .fmtFunction = yamlFormat } },
- { HEADER_EXT_MORE, NULL, { (void *) headerDefaultFormats } }
+ { HEADER_EXT_MORE, NULL, { (void *) &headerDefaultFormats } }
} ;
/*@=type@*/
+
+headerSprintfExtension headerCompoundFormats = &_headerCompoundFormats[0];
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/header.c
============================================================================
$ cvs diff -u -r1.129 -r1.130 header.c
--- rpm/rpmdb/header.c 23 Nov 2007 07:06:01 -0000 1.129
+++ rpm/rpmdb/header.c 24 Nov 2007 17:18:58 -0000 1.130
@@ -12,7 +12,8 @@
#define __HEADER_PROTOTYPES__
-#include <rpmio_internal.h> /* XXX for fdGetOPath() */
+#include <rpmio.h>
+#define _RPMTAG_INTERNAL
#include <header_internal.h>
#include "debug.h"
@@ -1724,7 +1725,7 @@
{
void * sw;
const char * name = tagName(tag);
- headerSprintfExtension exts = (headerSprintfExtension)headerCompoundFormats;
+ headerSprintfExtension exts = headerCompoundFormats;
headerSprintfExtension ext;
HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he));
size_t nb = 0;
@@ -1738,7 +1739,7 @@
/* 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++)
+ ext = (ext->type == HEADER_EXT_MORE ? *ext->u.more : ext+1), extNum++)
{
if (ext->name == NULL || ext->type != HEADER_EXT_TAG)
continue;
@@ -2658,7 +2659,7 @@
/* 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++)
+ ext = (ext->type == HEADER_EXT_MORE ? *ext->u.more : ext+1), extNum++)
{
if (ext->name == NULL || ext->type != HEADER_EXT_TAG)
continue;
@@ -2680,7 +2681,7 @@
/* Search extensions for specific format. */
if (stag->type != NULL)
for (ext = exts; ext != NULL && ext->type != HEADER_EXT_LAST;
- ext = (ext->type == HEADER_EXT_MORE ? ext->u.more : ext+1))
+ ext = (ext->type == HEADER_EXT_MORE ? *ext->u.more : ext+1))
{
if (ext->name == NULL || ext->type != HEADER_EXT_FORMAT)
continue;
@@ -2909,7 +2910,7 @@
}
/*@-type@*/ /* FIX: cast? */
-const struct headerSprintfExtension_s headerDefaultFormats[] = {
+static struct headerSprintfExtension_s _headerDefaultFormats[] = {
{ HEADER_EXT_FORMAT, "octal",
{ .fmtFunction = octFormat } },
{ HEADER_EXT_FORMAT, "oct",
@@ -2930,6 +2931,8 @@
};
/*@=type@*/
+headerSprintfExtension headerDefaultFormats = &_headerDefaultFormats[0];
+
/* forward ref */
/**
* Parse a headerSprintf expression.
@@ -3720,7 +3723,7 @@
if (exts != NULL)
for (ext = exts, extNum = 0; ext != NULL && ext->type != HEADER_EXT_LAST;
- ext = (ext->type == HEADER_EXT_MORE ? ext->u.more : ext+1), extNum++)
+ ext = (ext->type == HEADER_EXT_MORE ? *ext->u.more : ext+1), extNum++)
{
;
}
@@ -3744,7 +3747,7 @@
int extNum;
for (ext = exts, extNum = 0; ext != NULL && ext->type != HEADER_EXT_LAST;
- ext = (ext->type == HEADER_EXT_MORE ? ext->u.more : ext+1), extNum++)
+ ext = (ext->type == HEADER_EXT_MORE ? *ext->u.more : ext+1), extNum++)
{
(void) rpmheClean(&ec[extNum]);
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/header_internal.c
============================================================================
$ cvs diff -u -r1.17 -r1.18 header_internal.c
--- rpm/rpmdb/header_internal.c 22 Nov 2007 18:50:27 -0000 1.17
+++ rpm/rpmdb/header_internal.c 24 Nov 2007 17:18:58 -0000 1.18
@@ -5,6 +5,7 @@
#include "system.h"
+#define _RPMTAG_INTERNAL
#include <header_internal.h>
#include "debug.h"
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/pkgio.c
============================================================================
$ cvs diff -u -r1.58 -r1.59 pkgio.c
--- rpm/rpmdb/pkgio.c 23 Nov 2007 23:52:35 -0000 1.58
+++ rpm/rpmdb/pkgio.c 24 Nov 2007 17:18:58 -0000 1.59
@@ -18,7 +18,9 @@
#include <rpmio_internal.h>
#include <rpmmacro.h>
#include <rpmcb.h> /* XXX fnpyKey */
-#include <rpmtag.h>
+
+#define _RPMTAG_INTERNAL
+#include "header_internal.h"
#include <rpmdb.h>
#include <pkgio.h>
@@ -28,7 +30,6 @@
#include <rpmxar.h>
-#include "header_internal.h"
#include "signature.h"
#include "debug.h"
@@ -508,7 +509,7 @@
/* With XAR, read lead from a xar archive file called "Lead". */
xar = fdGetXAR(fd);
if (xar != NULL) {
- void *b = NULL;
+ unsigned char *b = NULL;
size_t nb = 0;
const char item[] = "Lead";
if ((xx = rpmxarNext(xar)) != 0 || (xx = rpmxarPull(xar, item)) != 0) {
@@ -517,12 +518,12 @@
rc = RPMRC_NOTFOUND;
goto exit;
}
- (void) rpmxarSwapBuf(xar, NULL, 0, (char **)&b, &nb);
+ (void) rpmxarSwapBuf(xar, NULL, 0, &b, &nb);
if (nb != sizeof(*l)) {
- b = _free(b);
(void) snprintf(buf, sizeof(buf),
_("lead size(%u): BAD, xar read(%u)"),
(unsigned)sizeof(*l), (unsigned)nb);
+ b = _free(b);
rc = RPMRC_FAIL;
goto exit;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/rpmdb.c
============================================================================
$ cvs diff -u -r1.217 -r1.218 rpmdb.c
--- rpm/rpmdb/rpmdb.c 22 Nov 2007 18:50:27 -0000 1.217
+++ rpm/rpmdb/rpmdb.c 24 Nov 2007 17:18:58 -0000 1.218
@@ -15,7 +15,9 @@
#define _MIRE_INTERNAL
#include <rpmmacro.h>
#include <rpmsq.h>
-#include <rpmtag.h>
+
+#define _RPMTAG_INTERNAL
+#include "header_internal.h" /* XXX for HEADERFLAG_ALLOCATED */
#define _RPMEVR_INTERNAL /* XXX isInstallPrereq */
#include <rpmevr.h>
@@ -33,7 +35,6 @@
#include "pkgio.h"
#include "fprint.h"
#include "legacy.h"
-#include "header_internal.h" /* XXX for HEADERFLAG_ALLOCATED */
#include "debug.h"
@@ -836,12 +837,11 @@
static inline /*@null@*/ const char * queryHeader(Header h, const char * qfmt)
/*@globals headerDefaultFormats @*/
{
- static const struct headerSprintfExtension_s * hdrfmts = headerDefaultFormats;
const char * errstr = "(unkown error)";
const char * str;
/*@-modobserver@*/
- str = headerSprintf(h, qfmt, rpmTagTable, hdrfmts, &errstr);
+ str = headerSprintf(h, qfmt, rpmTagTable, headerDefaultFormats, &errstr);
/*@=modobserver@*/
if (str == NULL)
rpmlog(RPMLOG_ERR, _("incorrect format: \"%s\": %s\n"), qfmt, errstr);
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/rpmtag.h
============================================================================
$ cvs diff -u -r1.8 -r1.9 rpmtag.h
--- rpm/rpmdb/rpmtag.h 23 Nov 2007 07:06:01 -0000 1.8
+++ rpm/rpmdb/rpmtag.h 24 Nov 2007 17:18:58 -0000 1.9
@@ -93,6 +93,13 @@
RPM_SCALAR_RETURN_TYPE = 0x00010000,
RPM_ARRAY_RETURN_TYPE = 0x00020000,
RPM_MAPPING_RETURN_TYPE = 0x00040000,
+ /* 0x00080000 */
+ RPM_PROBE_RETURN_TYPE = 0x00100000,
+ RPM_TREE_RETURN_TYPE = 0x00200000,
+ RPM_OPENPGP_RETURN_TYPE = 0x00400000,
+ RPM_X509_RETURN_TYPE = 0x00800000,
+ RPM_ASN1_RETURN_TYPE = 0x01000000,
+ RPM_OPAQUE_RETURN_TYPE = 0x10000000,
RPM_MASK_RETURN_TYPE = 0xffff0000
} rpmTagReturnType;
/*@=enummemuse =typeuse @*/
@@ -119,7 +126,7 @@
/** \ingroup header
*/
-typedef /*@abstract@*/ struct headerSprintfExtension_s * headerSprintfExtension;
+typedef /*@abstract@*/ const struct headerSprintfExtension_s * headerSprintfExtension;
/**
* Pseudo-tags used by the rpmdb and rpmgi iterator API's.
@@ -541,14 +548,15 @@
#endif
+#if defined(_RPMTAG_INTERNAL)
/** \ingroup header
*/
-enum headerSprintfExtensionType {
+typedef enum headerSprintfExtensionType_e {
HEADER_EXT_LAST = 0, /*!< End of extension chain. */
HEADER_EXT_FORMAT, /*!< headerTagFormatFunction() extension */
HEADER_EXT_MORE, /*!< Chain to next table. */
HEADER_EXT_TAG /*!< headerTagTagFunction() extension */
-};
+} headerSprintfExtensionType;
/** \ingroup header
* HEADER_EXT_TAG format function prototype.
@@ -575,7 +583,7 @@
*/
#if !defined(SWIG)
struct headerSprintfExtension_s {
- enum headerSprintfExtensionType type; /*!< Type of extension. */
+ headerSprintfExtensionType type; /*!< Type of extension. */
/*@observer@*/ /*@null@*/
const char * name; /*!< Name of extension. */
union {
@@ -583,17 +591,18 @@
void * generic; /*!< Private extension. */
headerTagFormatFunction fmtFunction; /*!< HEADER_EXT_TAG extension. */
headerTagTagFunction tagFunction; /*!< HEADER_EXT_FORMAT extension. */
- struct headerSprintfExtension_s * more; /*!< Chained table extension. */
+ headerSprintfExtension * more; /*!< Chained table extension. */
} u;
};
#endif
+#endif /* _RPMTAG_INTERNAL */
/** \ingroup header
* Supported default header tag output formats.
*/
/*@-redecl@*/
/*@observer@*/
-extern const struct headerSprintfExtension_s headerDefaultFormats[];
+extern headerSprintfExtension headerDefaultFormats;
/*@=redecl@*/
/** \ingroup header
@@ -601,7 +610,7 @@
*/
/*@-redecl@*/
/*@observer@*/
-extern const struct headerSprintfExtension_s headerCompoundFormats[];
+extern headerSprintfExtension headerCompoundFormats;
/*@=redecl@*/
#ifdef __cplusplus
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmdb/rpmwf.c
============================================================================
$ cvs diff -u -r1.20 -r1.21 rpmwf.c
--- rpm/rpmdb/rpmwf.c 23 Nov 2007 23:52:35 -0000 1.20
+++ rpm/rpmdb/rpmwf.c 24 Nov 2007 17:18:58 -0000 1.21
@@ -42,7 +42,7 @@
if (_rpmwf_debug)
fprintf(stderr, "==> rpmwfPushXAR(%p, %s) %p[%u]\n", wf, fn, b, (unsigned) nb);
- xx = rpmxarPush(wf->xar, fn, b, nb);
+ xx = rpmxarPush(wf->xar, fn, (unsigned char *)b, nb);
return (xx == 0 ? RPMRC_OK : RPMRC_FAIL);
}
@@ -56,7 +56,7 @@
xx = rpmxarPull(wf->xar, fn);
if (xx == 1)
return RPMRC_NOTFOUND;
- xx = rpmxarSwapBuf(wf->xar, NULL, 0, &b, &nb);
+ xx = rpmxarSwapBuf(wf->xar, NULL, 0, (unsigned char **)&b, &nb);
if (_rpmwf_debug)
fprintf(stderr, "==> rpmwfPullXAR(%p, %s) %p[%u]\n", wf, fn, b, (unsigned) nb);
@@ -266,10 +266,10 @@
/*@*/
{
fprintf(stderr, "==> %s(%s) wf %p\n", msg, fn, wf);
- rpmwfDumpItem(" Lead", wf->l, wf->nl);
- rpmwfDumpItem("Signature", wf->s, wf->ns);
- rpmwfDumpItem(" Header", wf->h, wf->nh);
- rpmwfDumpItem(" Payload", wf->p, wf->np);
+ rpmwfDumpItem(" Lead", (unsigned char *)wf->l, wf->nl);
+ rpmwfDumpItem("Signature", (unsigned char *)wf->s, wf->ns);
+ rpmwfDumpItem(" Header", (unsigned char *)wf->h, wf->nh);
+ rpmwfDumpItem(" Payload", (unsigned char *)wf->p, wf->np);
}
rpmwf rdRPM(const char * rpmfn)
@@ .
Received on Sat Nov 24 18:18:59 2007