RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 04-Apr-2009 20:57:13 Branch: rpm-5_1 Handle: 2009040418571101 Modified files: (Branch: rpm-5_1) rpm CHANGES rpm/rpmdb Makefile.am header.c pkgio.h rpmdb.c rpmdb.h rpmevr.c rpmevr.h rpmwf.c rpmwf.h tagname.c Log: - jbj: random line noise reduction, diff'ing against HEAD. Summary: Revision Changes Path 1.2288.2.273+1 -0 rpm/CHANGES 1.94.4.4 +1 -0 rpm/rpmdb/Makefile.am 1.153.2.14 +23 -23 rpm/rpmdb/header.c 1.15.4.1 +6 -6 rpm/rpmdb/pkgio.h 1.246.2.15 +69 -58 rpm/rpmdb/rpmdb.c 1.73.2.7 +22 -19 rpm/rpmdb/rpmdb.h 1.29.2.6 +16 -9 rpm/rpmdb/rpmevr.c 1.9.2.4 +3 -2 rpm/rpmdb/rpmevr.h 1.22.4.4 +10 -9 rpm/rpmdb/rpmwf.c 1.10.4.3 +16 -14 rpm/rpmdb/rpmwf.h 1.28.2.4 +8 -8 rpm/rpmdb/tagname.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2288.2.272 -r1.2288.2.273 CHANGES --- rpm/CHANGES 4 Apr 2009 16:38:43 -0000 1.2288.2.272 +++ rpm/CHANGES 4 Apr 2009 18:57:11 -0000 1.2288.2.273 @@ -1,4 +1,5 @@ 5.1.7 -> 5.1.8: + - jbj: random line noise reduction, diff'ing against HEAD. - jbj: wire-up RPMTAG_FILEDIGESTALGO. wotta waste to pretend "compatible" ... - jbj: yaml: add build scriptlet tags for --yaml/--xml display. - jbj: eliminate rpmal debugging code. @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/Makefile.am ============================================================================ $ cvs diff -u -r1.94.4.3 -r1.94.4.4 Makefile.am --- rpm/rpmdb/Makefile.am 10 Jan 2009 22:32:58 -0000 1.94.4.3 +++ rpm/rpmdb/Makefile.am 4 Apr 2009 18:57:12 -0000 1.94.4.4 @@ -17,6 +17,7 @@ @WITH_ZLIB_CPPFLAGS@ \ @WITH_LUA_CPPFLAGS@ \ @WITH_FILE_CPPFLAGS@ \ + @WITH_PCRE_CPPFLAGS@ \ @WITH_XAR_CPPFLAGS@ EXTRA_DIST = db3.c sqlite.c db_emu.h librpmdb.vers @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/header.c ============================================================================ $ cvs diff -u -r1.153.2.13 -r1.153.2.14 header.c --- rpm/rpmdb/header.c 27 Mar 2009 17:42:31 -0000 1.153.2.13 +++ rpm/rpmdb/header.c 4 Apr 2009 18:57:12 -0000 1.153.2.14 @@ -107,35 +107,35 @@ { Header h = _h; - if (h->index != NULL) { - indexEntry entry = h->index; - size_t i; - for (i = 0; i < h->indexUsed; i++, entry++) { + if (h->index != NULL) { + indexEntry entry = h->index; + size_t i; + for (i = 0; i < h->indexUsed; i++, entry++) { if ((h->flags & HEADERFLAG_ALLOCATED) && ENTRY_IS_REGION(entry)) { - if (entry->length > 0) { - uint32_t * ei = entry->data; - if ((ei - 2) == h->blob) - h->blob = _free(h->blob); - entry->data = NULL; - } - } else if (!ENTRY_IN_REGION(entry)) { - entry->data = _free(entry->data); + if (entry->length > 0) { + uint32_t * ei = entry->data; + if ((ei - 2) == h->blob) + h->blob = _free(h->blob); + entry->data = NULL; } - entry->data = NULL; + } else if (!ENTRY_IN_REGION(entry)) { + entry->data = _free(entry->data); } - h->index = _free(h->index); + entry->data = NULL; } - h->origin = _free(h->origin); - h->baseurl = _free(h->baseurl); - h->digest = _free(h->digest); + h->index = _free(h->index); + } + h->origin = _free(h->origin); + h->baseurl = _free(h->baseurl); + h->digest = _free(h->digest); /*...@-nullstate@*/ - if (_hdr_stats) { - if (_hdr_loadops) /* RPMTS_OP_HDRLOAD */ - (void) rpmswAdd(_hdr_loadops, headerGetStats(h, 18)); - if (_hdr_getops) /* RPMTS_OP_HDRGET */ - (void) rpmswAdd(_hdr_getops, headerGetStats(h, 19)); - } + if (_hdr_stats) { + if (_hdr_loadops) /* RPMTS_OP_HDRLOAD */ + (void) rpmswAdd(_hdr_loadops, headerGetStats(h, 18)); + if (_hdr_getops) /* RPMTS_OP_HDRGET */ + (void) rpmswAdd(_hdr_getops, headerGetStats(h, 19)); + } /*...@=nullstate@*/ } /*...@=mustmod@*/ @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/pkgio.h ============================================================================ $ cvs diff -u -r1.15 -r1.15.4.1 pkgio.h --- rpm/rpmdb/pkgio.h 16 Dec 2007 17:45:58 -0000 1.15 +++ rpm/rpmdb/pkgio.h 4 Apr 2009 18:57:12 -0000 1.15.4.1 @@ -48,8 +48,8 @@ * @return RPMRC_OK on success */ rpmRC rpmpkgWrite(const char * fn, FD_t fd, void * ptr, const char ** msg) - /*...@globals fileSystem @*/ - /*...@modifies fd, ptr, *msg, fileSystem @*/; + /*...@globals fileSystem, internalState @*/ + /*...@modifies fd, ptr, *msg, fileSystem, internalState @*/; /** * Read item from file descriptor. @@ -61,8 +61,8 @@ */ rpmRC rpmpkgRead(const char * fn, FD_t fd, /*...@null@*/ /*...@out@*/ void * ptr, const char ** msg) - /*...@globals fileSystem @*/ - /*...@modifies fd, *ptr, *msg, fileSystem @*/; + /*...@globals fileSystem, internalState @*/ + /*...@modifies fd, *ptr, *msg, fileSystem, internalState @*/; /** * Verify item integrity. @@ -73,8 +73,8 @@ * @return RPMRC_OK on success */ rpmRC rpmpkgCheck(const char * fn, FD_t fd, const void * ptr, const char ** msg) - /*...@globals fileSystem @*/ - /*...@modifies ptr, *msg, fileSystem @*/; + /*...@globals fileSystem, internalState @*/ + /*...@modifies ptr, *msg, fileSystem, internalState @*/; #ifdef __cplusplus } @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmdb.c ============================================================================ $ cvs diff -u -r1.246.2.14 -r1.246.2.15 rpmdb.c --- rpm/rpmdb/rpmdb.c 2 Apr 2009 17:57:23 -0000 1.246.2.14 +++ rpm/rpmdb/rpmdb.c 4 Apr 2009 18:57:12 -0000 1.246.2.15 @@ -185,17 +185,17 @@ /** * Return dbi index used for rpm tag. * @param db rpm database - * @param rpmtag rpm header tag + * @param tag rpm tag * @return dbi index, 0xffffffff on error */ -static size_t dbiTagToDbix(rpmdb db, rpmTag rpmtag) +static size_t dbiTagToDbix(rpmdb db, rpmTag tag) /*...@*/ { size_t dbix; if (db->db_tags != NULL) for (dbix = 0; dbix < db->db_ndbi; dbix++) { - if (rpmtag != db->db_tags[dbix].tag) + if (tag != db->db_tags[dbix].tag) continue; return dbix; } @@ -208,8 +208,8 @@ /*...@-exportheader@*/ static void dbiTagsInit(/*...@null@*/ tagStore_t * dbiTagsP, /*...@null@*/ size_t * dbiNTagsP) - /*...@globals rpmGlobalMacroContext, h_errno @*/ - /*...@modifies *dbiTagsP, *dbiNTagsP, rpmGlobalMacroContext @*/ + /*...@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*...@modifies *dbiTagsP, *dbiNTagsP, rpmGlobalMacroContext, internalState @*/ { /*...@observer@*/ static const char * const _dbiTagStr_default = @@ -218,7 +218,7 @@ size_t dbiNTags = 0; char * dbiTagStr = NULL; char * o, * oe; - rpmTag rpmtag; + rpmTag tag; size_t dbix; int bingo; @@ -248,12 +248,12 @@ } if (oe && *oe) *oe++ = '\0'; - rpmtag = tagValue(o); + tag = tagValue(o); bingo = 0; if (dbiTags != NULL) for (dbix = 0; dbix < dbiNTags; dbix++) { - if (rpmtag == dbiTags[dbix].tag) { + if (tag == dbiTags[dbix].tag) { bingo = 1; /*...@innerbreak@*/ break; } @@ -263,7 +263,7 @@ dbiTags = xrealloc(dbiTags, (dbiNTags + 1) * sizeof(*dbiTags)); dbiTags[dbiNTags].str = xstrdup(o); - dbiTags[dbiNTags].tag = rpmtag; + dbiTags[dbiNTags].tag = tag; dbiTags[dbiNTags].iob = NULL; dbiNTags++; } @@ -323,7 +323,7 @@ return ret; } -dbiIndex dbiOpen(rpmdb db, rpmTag rpmtag, /*...@unused@*/ unsigned int flags) +dbiIndex dbiOpen(rpmdb db, rpmTag tag, /*...@unused@*/ unsigned int flags) { static int _oneshot = 0; size_t dbix; @@ -352,17 +352,17 @@ /*...@-modfilesys@*/ if (_rpmdb_debug) -fprintf(stderr, "==> dbiOpen(%p, %u, 0x%x)\n", db, rpmtag, flags); +fprintf(stderr, "==> dbiOpen(%p, %s(%u), 0x%x)\n", db, tagName(tag), tag, flags); /*...@=modfilesys@*/ if (db == NULL) return NULL; - dbix = dbiTagToDbix(db, rpmtag); + dbix = dbiTagToDbix(db, tag); if (dbix >= db->db_ndbi) return NULL; dbiTag = db->db_tags + dbix; - dbiBN = (dbiTag->str != NULL ? dbiTag->str : tagName(rpmtag)); + dbiBN = (dbiTag->str != NULL ? dbiTag->str : tagName(tag)); /* Is this index already open ? */ /*...@-compdef@*/ /* FIX: db->_dbi may be NULL */ @@ -385,13 +385,13 @@ } errno = 0; dbi = NULL; - rc = (*mydbvecs[_dbapi]->open) (db, rpmtag, &dbi); + rc = (*mydbvecs[_dbapi]->open) (db, tag, &dbi); if (rc) { static int _printed[32]; if (!_printed[dbix & 0x1f]++) rpmlog(RPMLOG_ERR, _("cannot open %s(%u) index using db%d - %s (%d)\n"), - dbiBN, rpmtag, _dbapi, + dbiBN, tag, _dbapi, (rc > 0 ? strerror(rc) : ""), rc); _dbapi = -1; } @@ -403,7 +403,7 @@ continue; errno = 0; dbi = NULL; - rc = (*mydbvecs[_dbapi]->open) (db, rpmtag, &dbi); + rc = (*mydbvecs[_dbapi]->open) (db, tag, &dbi); if (rc == 0 && dbi) /*...@loopbreak@*/ break; } @@ -411,7 +411,7 @@ static int _printed[32]; if (!_printed[dbix & 0x1f]++) rpmlog(RPMLOG_ERR, _("cannot open %s(%u) index\n"), - dbiBN, rpmtag); + dbiBN, tag); rc = 1; goto exit; } @@ -425,7 +425,7 @@ if (db->_dbi != NULL) db->_dbi[dbix] = dbi; /*...@-sizeoftype@*/ - if (rpmtag == RPMDBI_PACKAGES && db->db_bits == NULL) { + if (tag == RPMDBI_PACKAGES && db->db_bits == NULL) { db->db_nbits = 1024; if (!dbiStat(dbi, DB_FAST_STAT)) { DB_HASH_STAT * hash = (DB_HASH_STAT *)dbi->dbi_stats; @@ -768,6 +768,10 @@ || sigismember(&rpmsqCaught, SIGHUP) || sigismember(&rpmsqCaught, SIGTERM) || sigismember(&rpmsqCaught, SIGPIPE) +#ifdef NOTYET /* XXX todo++ */ + || sigismember(&rpmsqCaught, SIGXCPU) + || sigismember(&rpmsqCaught, SIGXFSZ) +#endif || terminate) terminating = 1; @@ -944,12 +948,12 @@ if (db->db_tags != NULL && db->_dbi != NULL) for (dbix = 0; dbix < db->db_ndbi; dbix++) { tagStore_t dbiTag = db->db_tags + dbix; - int rpmtag = dbiTag->tag; - if (rpmtag < 0) + int tag = dbiTag->tag; + if (tag < 0) continue; if (db->_dbi[dbix] != NULL) continue; - switch (rpmtag) { + switch (tag) { case RPMDBI_AVAILABLE: case RPMDBI_ADDED: case RPMDBI_REMOVED: @@ -959,14 +963,14 @@ default: /*...@switchbreak@*/ break; } - (void) dbiOpen(db, rpmtag, db->db_flags); + (void) dbiOpen(db, tag, db->db_flags); } return rc; } -int rpmdbBlockDBI(rpmdb db, int rpmtag) +int rpmdbBlockDBI(rpmdb db, int tag) { - rpmTag tagn = (rpmTag)(rpmtag >= 0 ? rpmtag : -rpmtag); + rpmTag tagn = (rpmTag)(tag >= 0 ? tag : -tag); size_t dbix; if (db == NULL || db->_dbi == NULL) @@ -976,13 +980,13 @@ for (dbix = 0; dbix < db->db_ndbi; dbix++) { if (db->db_tags[dbix].tag != tagn) continue; - db->db_tags[dbix].tag = rpmtag; + db->db_tags[dbix].tag = tag; return 0; } return 0; } -int rpmdbCloseDBI(rpmdb db, int rpmtag) +int rpmdbCloseDBI(rpmdb db, int tag) { size_t dbix; int rc = 0; @@ -992,7 +996,7 @@ if (db->db_tags != NULL) for (dbix = 0; dbix < db->db_ndbi; dbix++) { - if (db->db_tags[dbix].tag != (rpmTag)rpmtag) + if (db->db_tags[dbix].tag != (rpmTag)tag) continue; if (db->_dbi[dbix] != NULL) { int xx; @@ -1036,9 +1040,9 @@ if (db->_dbi[dbix] == NULL) continue; /*...@-unqualifiedtrans@*/ /* FIX: double indirection. */ - xx = dbiClose(db->_dbi[dbix], 0); + xx = dbiClose(db->_dbi[dbix], 0); if (xx && rc == 0) rc = xx; - db->_dbi[dbix] = NULL; + db->_dbi[dbix] = NULL; /*...@=unqualifiedtrans@*/ } db->db_errpfx = _free(db->db_errpfx); @@ -1099,8 +1103,8 @@ * @return macro expanded absolute path */ static const char * rpmdbURIPath(const char *uri) - /*...@globals rpmGlobalMacroContext, h_errno @*/ - /*...@modifies rpmGlobalMacroContext @*/ + /*...@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*...@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ { const char * s = rpmGetPath(uri, NULL); const char * fn = NULL; @@ -1172,7 +1176,7 @@ /*...@=modfilesys@*/ /*...@=nullpass@*/ if (!oneshot) { - _db_filter_dups = rpmExpandNumeric("%{_filterdbdups}"); + _db_filter_dups = rpmExpandNumeric("%{?_filterdbdups}"); oneshot = 1; } @@ -1253,11 +1257,11 @@ if (db->db_tags != NULL) for (dbix = 0; rc == 0 && dbix < db->db_ndbi; dbix++) { tagStore_t dbiTag = db->db_tags + dbix; - rpmTag rpmtag = dbiTag->tag; + rpmTag tag = dbiTag->tag; dbiIndex dbi; /* Filter out temporary databases */ - switch (rpmtag) { + switch (tag) { case RPMDBI_AVAILABLE: case RPMDBI_ADDED: case RPMDBI_REMOVED: @@ -1268,13 +1272,13 @@ /*...@switchbreak@*/ break; } - dbi = dbiOpen(db, rpmtag, 0); + dbi = dbiOpen(db, tag, 0); if (dbi == NULL) { rc = -2; break; } - switch (rpmtag) { + switch (tag) { case RPMDBI_PACKAGES: if (dbi == NULL) rc |= 1; #if 0 @@ -1312,7 +1316,7 @@ /* XXX python/rpmmodule.c */ int rpmdbOpen (const char * prefix, rpmdb *dbp, int mode, int perms) { - int _dbapi = rpmExpandNumeric("%{_dbapi}"); + int _dbapi = rpmExpandNumeric("%{?_dbapi}"); return rpmdbOpenDatabase(prefix, NULL, _dbapi, dbp, mode, perms, 0); } @@ -2139,8 +2143,8 @@ } else { void *use = mi->mi_re->_item.use; void *pool = mi->mi_re->_item.pool; - mi->mi_re = xrealloc(mi->mi_re, (mi->mi_nre + 1) * sizeof(*mi->mi_re)); - mire = mi->mi_re + mi->mi_nre; + mi->mi_re = xrealloc(mi->mi_re, (mi->mi_nre + 1) * sizeof(*mi->mi_re)); + mire = mi->mi_re + mi->mi_nre; memset(mire, 0, sizeof(*mire)); /* XXX ensure no segfault, copy the use/pool from 1st item. */ /*...@-assignexpose@*/ @@ -2178,7 +2182,8 @@ */ /*...@-onlytrans@*/ /* XXX miRE array, not refcounted. */ static int mireSkip (const rpmdbMatchIterator mi) - /*...@modifies mi->mi_re @*/ + /*...@globals internalState @*/ + /*...@modifies mi->mi_re, internalState @*/ { HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he)); char numbuf[32]; @@ -2687,7 +2692,7 @@ return 0; } -rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmTag rpmtag, +rpmdbMatchIterator rpmdbInitIterator(rpmdb db, rpmTag tag, const void * keyp, size_t keylen) /*...@globals rpmmiRock @*/ /*...@modifies rpmmiRock @*/ @@ -2706,12 +2711,12 @@ (void) rpmdbCheckSignals(); /* XXX HACK to remove rpmdbFindByLabel/findMatches from the API */ - if (rpmtag == RPMDBI_LABEL) { - rpmtag = RPMTAG_NAME; + if (tag == RPMDBI_LABEL) { + tag = RPMTAG_NAME; isLabel = 1; } - dbi = dbiOpen(db, rpmtag, 0); + dbi = dbiOpen(db, tag, 0); if (dbi == NULL) return NULL; @@ -2727,7 +2732,7 @@ * Handle label and file name special cases. * Otherwise, retrieve join keys for secondary lookup. */ - if (rpmtag != RPMDBI_PACKAGES && keyp) { + if (tag != RPMDBI_PACKAGES && keyp) { DBC * dbcursor = NULL; int rc; int xx; @@ -2737,7 +2742,7 @@ rc = dbiFindByLabel(dbi, dbcursor, key, data, keyp, &set); xx = dbiCclose(dbi, dbcursor, 0); dbcursor = NULL; - } else if (rpmtag == RPMTAG_BASENAMES) { + } else if (tag == RPMTAG_BASENAMES) { rc = rpmdbFindByFile(db, keyp, key, data, &set); } else { xx = dbiCopen(dbi, dbi->dbi_txnid, &dbcursor, 0); @@ -2776,7 +2781,7 @@ /* Copy the retrieval key, byte swapping header instance if necessary. */ if (keyp) { - switch (rpmtag) { + switch (tag) { case RPMDBI_PACKAGES: { union _dbswap *k; @@ -2805,7 +2810,7 @@ /*...@-assignexpose@*/ mi->mi_db = rpmdbLink(db, "matchIterator"); /*...@=assignexpose@*/ - mi->mi_rpmtag = rpmtag; + mi->mi_rpmtag = tag; mi->mi_dbc = NULL; mi->mi_set = set; @@ -2941,15 +2946,15 @@ if (db->db_tags != NULL) for (dbix = 0; dbix < db->db_ndbi; dbix++) { tagStore_t dbiTag = db->db_tags + dbix; - rpmTag rpmtag = dbiTag->tag; + rpmTag tag = dbiTag->tag; const char * dbiBN = (dbiTag->str != NULL - ? dbiTag->str : tagName(rpmtag)); + ? dbiTag->str : tagName(tag)); dbiIndex dbi; uint8_t * bin = NULL; int i; dbi = NULL; - he->tag = rpmtag; + he->tag = tag; he->t = 0; he->p.ptr = NULL; he->c = 0; @@ -3893,10 +3898,12 @@ const char * ofn, * nfn; int rc = 0; int xx; +/*...@-moduncon -noeffectun...@*/ int selinux = is_selinux_enabled() > 0 && (matchpathcon_init(NULL) != -1); +/*...@=moduncon =noeffectun...@*/ sigset_t sigMask; - blockSignals(NULL, &sigMask); + (void) blockSignals(NULL, &sigMask); switch (_olddbapi) { default: case 4: @@ -3906,12 +3913,12 @@ size_t i; if (dbiTags != NULL) for (i = 0; i < dbiNTags; i++) { - rpmTag rpmtag = dbiTags[i].tag; + rpmTag tag = dbiTags[i].tag; const char * dbiBN = (dbiTags[i].str != NULL - ? dbiTags[i].str : tagName(rpmtag)); + ? dbiTags[i].str : tagName(tag)); /* Filter out temporary databases */ - switch (rpmtag) { + switch (tag) { case RPMDBI_AVAILABLE: case RPMDBI_ADDED: case RPMDBI_REMOVED: @@ -3957,6 +3964,7 @@ /*...@=type@*/ xx = Utime(nfn, &stamp); } +/*...@-moduncon -noeffectun...@*/ if (selinux) { security_context_t scon = NULL; if (matchpathcon(nfn, nst->st_mode, &scon) != -1) @@ -3964,6 +3972,7 @@ if (scon != NULL) freecon(scon); } +/*...@=moduncon =noeffectun...@*/ bottom: ofn = _free(ofn); @@ -3995,10 +4004,12 @@ case 0: break; } - unblockSignals(NULL, &sigMask); + (void) unblockSignals(NULL, &sigMask); +/*...@-moduncon -noeffectun...@*/ if (selinux) matchpathcon_fini(); +/*...@=moduncon =noeffectun...@*/ return rc; } @@ -4006,7 +4017,7 @@ /*...@globals _rebuildinprogress @*/ /*...@modifies _rebuildinprogress @*/ { - const char * myprefix; + const char * myprefix = NULL; rpmdb olddb; const char * dbpath = NULL; const char * rootdbpath = NULL; @@ -4095,7 +4106,7 @@ rpmlog(RPMLOG_DEBUG, D_("opening old database with dbapi %d\n"), _dbapi); - if (rpmdbOpenDatabase(myprefix, dbpath, _dbapi, &olddb, O_RDONLY, 0644, + if (rpmdbOpenDatabase(myprefix, dbpath, _dbapi, &olddb, O_RDONLY, 0644, RPMDB_FLAG_MINIMAL)) { rc = 1; goto exit; @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmdb.h ============================================================================ $ cvs diff -u -r1.73.2.6 -r1.73.2.7 rpmdb.h --- rpm/rpmdb/rpmdb.h 27 Mar 2009 17:42:31 -0000 1.73.2.6 +++ rpm/rpmdb/rpmdb.h 4 Apr 2009 18:57:12 -0000 1.73.2.7 @@ -83,10 +83,10 @@ /** \ingroup dbi * Return handle for an index database. * @param rpmdb rpm database - * @param rpmtag rpm tag + * @param tag rpm tag * @return 0 on success */ - int (*open) (rpmdb rpmdb, rpmTag rpmtag, /*...@out@*/ dbiIndex * dbip) + int (*open) (rpmdb rpmdb, rpmTag tag, /*...@out@*/ dbiIndex * dbip) /*...@globals fileSystem @*/ /*...@modifies *dbip, fileSystem @*/; @@ -494,11 +494,11 @@ /** \ingroup db3 * Return new configured index database handle instance. * @param rpmdb rpm database - * @param rpmtag rpm tag + * @param tag rpm tag * @return index database handle */ /*...@unused@*/ /*...@only@*/ /*...@null@*/ -dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag) +dbiIndex db3New(rpmdb rpmdb, rpmTag tag) /*...@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*...@modifies rpmGlobalMacroContext, internalState @*/; @@ -527,14 +527,14 @@ /** \ingroup dbi * Return handle for an index database. * @param db rpm database - * @param rpmtag rpm tag + * @param tag rpm tag * @param flags (unused) * @return index database handle */ -/*...@only@*/ /*...@null@*/ dbiIndex dbiOpen(/*...@null@*/ rpmdb db, rpmTag rpmtag, +/*...@only@*/ /*...@null@*/ dbiIndex dbiOpen(/*...@null@*/ rpmdb db, rpmTag tag, unsigned int flags) - /*...@globals rpmGlobalMacroContext, errno, h_errno @*/ - /*...@modifies db, rpmGlobalMacroContext, errno @*/; + /*...@globals rpmGlobalMacroContext, errno, h_errno, internalState @*/ + /*...@modifies db, rpmGlobalMacroContext, errno, internalState @*/; /** * Return dbiStats accumulator structure. @@ -954,19 +954,19 @@ /** * Block access to a single database index. * @param db rpm database - * @param rpmtag rpm tag (negative to block) + * @param tag rpm tag (negative to block) * @return 0 on success */ -int rpmdbBlockDBI(/*...@null@*/ rpmdb db, int rpmtag) +int rpmdbBlockDBI(/*...@null@*/ rpmdb db, int tag) /*...@modifies db @*/; /** * Close a single database index. * @param db rpm database - * @param rpmtag rpm tag + * @param tag rpm tag * @return 0 on success */ -int rpmdbCloseDBI(/*...@null@*/ rpmdb db, int rpmtag) +int rpmdbCloseDBI(/*...@null@*/ rpmdb db, int tag) /*...@globals fileSystem @*/ /*...@modifies db, fileSystem @*/; @@ -995,8 +995,8 @@ */ /*...@-exportlocal@*/ int rpmdbOpenAll (/*...@null@*/ rpmdb db) - /*...@globals rpmGlobalMacroContext, h_errno @*/ - /*...@modifies db, rpmGlobalMacroContext @*/; + /*...@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*...@modifies db, rpmGlobalMacroContext, internalState @*/; /*...@=exportlocal@*/ /** \ingroup rpmdb @@ -1079,8 +1079,8 @@ */ int rpmdbSetIteratorRE(/*...@null@*/ rpmdbMatchIterator mi, rpmTag tag, rpmMireMode mode, /*...@null@*/ const char * pattern) - /*...@globals rpmGlobalMacroContext, h_errno @*/ - /*...@modifies mi, mode, rpmGlobalMacroContext @*/; + /*...@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*...@modifies mi, mode, rpmGlobalMacroContext, internalState @*/; /** \ingroup rpmdb * Prepare iterator for lazy writes. @@ -1113,13 +1113,13 @@ /** \ingroup rpmdb * Return database iterator. * @param db rpm database - * @param rpmtag rpm tag + * @param tag rpm tag * @param keyp key data (NULL for sequential access) * @param keylen key data length (0 will use strlen(keyp)) * @return NULL on failure */ /*...@only@*/ /*...@null@*/ -rpmdbMatchIterator rpmdbInitIterator(/*...@null@*/ rpmdb db, rpmTag rpmtag, +rpmdbMatchIterator rpmdbInitIterator(/*...@null@*/ rpmdb db, rpmTag tag, /*...@null@*/ const void * keyp, size_t keylen) /*...@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*...@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -1177,7 +1177,10 @@ */ int rpmdbMireApply(rpmdb db, rpmTag tag, rpmMireMode mode, const char * pat, const char *** argvp) - /*...@modifies db, *argvp */; + /*...@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*...@modifies db, *argvp, + rpmGlobalMacroContext, fileSystem, internalState @*/; + /** \ingroup rpmdb * Add package header to rpm database and indices. @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmevr.c ============================================================================ $ cvs diff -u -r1.29.2.5 -r1.29.2.6 rpmevr.c --- rpm/rpmdb/rpmevr.c 27 Mar 2009 17:42:31 -0000 1.29.2.5 +++ rpm/rpmdb/rpmevr.c 4 Apr 2009 18:57:12 -0000 1.29.2.6 @@ -82,6 +82,8 @@ const char * ae = NULL, * be = NULL; int rc = 0; /* assume equal */ +assert(a != NULL); +assert(b != NULL); /* Compare version strings segment by segment. */ for (; *a && *b && rc == 0; a = ae, b = be) { @@ -137,10 +139,11 @@ } /*...@unchecked@*/ /*...@observer@*/ /*...@null@*/ -static const char * _evr_tuple_match = "^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$"; -/*...@unchecked@*/ /*...@null@*/ +static const char * _evr_tuple_match = + "^(?:([^:-]+):)?([^:-]+)(?:-([^:-]+))?(?::([^:-]+))?$"; +/*...@unchecked@*/ /*...@only@*/ /*...@observer@*/ /*...@null@*/ const char * evr_tuple_match = NULL; -/*...@unchecked@*/ /*...@null@*/ +/*...@unchecked@*/ /*...@refcounted@*/ /*...@null@*/ miRE evr_tuple_mire = NULL; /*...@unchecked@*/ static int evr_tuple_nmire; @@ -148,6 +151,7 @@ static miRE rpmEVRmire(void) /*...@*/ { +/*...@-globs -internalglobs -mods @*/ if (evr_tuple_mire == NULL) { int xx; evr_tuple_match = rpmExpand("%{?evr_tuple_match}", NULL); @@ -164,6 +168,7 @@ #endif } +/*...@=globs =internalglobs =mods @*/ assert(evr_tuple_match != NULL && evr_tuple_mire != NULL); /*...@-globstate -retal...@*/ return evr_tuple_mire; @@ -240,7 +245,7 @@ switch (i/2) { default: - case 0: continue; /*...@notreached@*/ break; + case 0: continue; /*...@notreached@*/ /*...@switchbreak@*/ break; case 1: ix = RPMEVR_E; /*...@switchbreak@*/break; case 2: ix = RPMEVR_V; /*...@switchbreak@*/break; case 3: ix = RPMEVR_R; /*...@switchbreak@*/break; @@ -294,7 +299,7 @@ return rpmvercmp(a, b); } -/*...@unchecked@*/ /*...@null@*/ +/*...@unchecked@*/ /*...@only@*/ /*...@observer@*/ /*...@null@*/ static const char * evr_tuple_order = NULL; /** @@ -305,11 +310,13 @@ static const char * rpmEVRorder(void) /*...@*/ { +/*...@-globs -internalglobs -mods @*/ if (evr_tuple_order == NULL) { evr_tuple_order = rpmExpand("%{?evr_tuple_order}", NULL); if (evr_tuple_order == NULL || evr_tuple_order[0] == '\0') evr_tuple_order = xstrdup("EVR"); } +/*...@=globs =internalglobs =mods @*/ assert(evr_tuple_order != NULL && evr_tuple_order[0] != '\0'); return evr_tuple_order; } @@ -328,10 +335,10 @@ assert(b->F[RPMEVR_R] != NULL); assert(b->F[RPMEVR_D] != NULL); - for (s = rpmEVRorder(); *s; s++) { + for (s = rpmEVRorder(); *s != '\0'; s++) { int ix; switch ((int)*s) { - default: continue; /*...@notreached@*/ break; + default: continue; /*...@notreached@*/ /*...@switchbreak@*/break; case 'E': ix = RPMEVR_E; /*...@switchbreak@*/break; case 'V': ix = RPMEVR_V; /*...@switchbreak@*/break; case 'R': ix = RPMEVR_R; /*...@switchbreak@*/break; @@ -438,9 +445,9 @@ int rc = 0; int xx; - for (s = rpmEVRorder(); *s; s++) { + for (s = rpmEVRorder(); *s != '\0'; s++) { switch ((int)*s) { - default: continue; /*...@notreached@*/ break; + default: continue; /*...@notreached@*/ /*...@switchbreak@*/break; case 'E': Ahe->tag = RPMTAG_EPOCH; xx = headerGet(A, Ahe, 0); @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmevr.h ============================================================================ $ cvs diff -u -r1.9.2.3 -r1.9.2.4 rpmevr.h --- rpm/rpmdb/rpmevr.h 11 Jan 2009 18:50:30 -0000 1.9.2.3 +++ rpm/rpmdb/rpmevr.h 4 Apr 2009 18:57:12 -0000 1.9.2.4 @@ -80,6 +80,7 @@ * An EVR parsing container. */ struct EVR_s { +/*...@owned@*/ const char * str; /*!< EVR storage */ #ifndef DYING unsigned long Elong; /*!< E converted to integer. */ @@ -124,11 +125,11 @@ /** \ingroup rpmds * Create a new EVR container. - * @param flags EVR inequality flags + * @param Flags EVR inequality flags * @param initialize Should empty defaults be initialized? * @return initialized EVR container */ -EVR_t rpmEVRnew(uint32_t flags, int initialize) +EVR_t rpmEVRnew(uint32_t Flags, int initialize) /*...@*/; /** \ingroup rpmtd @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmwf.c ============================================================================ $ cvs diff -u -r1.22.4.3 -r1.22.4.4 rpmwf.c --- rpm/rpmdb/rpmwf.c 27 Mar 2009 17:42:31 -0000 1.22.4.3 +++ rpm/rpmdb/rpmwf.c 4 Apr 2009 18:57:12 -0000 1.22.4.4 @@ -132,6 +132,7 @@ } wf->l = wf->b; +assert(wf->l != NULL); wf->nl = 96; wf->s = wf->l + wf->nl; @@ -190,19 +191,19 @@ { rpmwf wf = _wf; - if (wf->b == NULL) { + if (wf->b == NULL) { /*...@-dependenttrans -onlytrans @*/ /* rpm needs dependent, xar needs only */ - wf->l = _free(wf->l); - wf->s = _free(wf->s); - wf->h = _free(wf->h); - wf->p = _free(wf->p); + wf->l = _free(wf->l); + wf->s = _free(wf->s); + wf->h = _free(wf->h); + wf->p = _free(wf->p); /*...@=dependenttrans =onlytrans @*/ - } + } - wf->xar = rpmxarFree(wf->xar, "rpmwfFree"); - (void) rpmwfFini(wf); + wf->xar = rpmxarFree(wf->xar, "rpmwfFree"); + (void) rpmwfFini(wf); - wf->fn = _free(wf->fn); + wf->fn = _free(wf->fn); } /*...@=mustmod@*/ @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/rpmwf.h ============================================================================ $ cvs diff -u -r1.10.4.2 -r1.10.4.3 rpmwf.h --- rpm/rpmdb/rpmwf.h 26 Mar 2009 20:10:03 -0000 1.10.4.2 +++ rpm/rpmdb/rpmwf.h 4 Apr 2009 18:57:12 -0000 1.10.4.3 @@ -56,12 +56,12 @@ /*...@modifies wf, fileSystem @*/; rpmRC rpmwfFini(rpmwf wf) - /*...@globals fileSystem @*/ - /*...@modifies wf, fileSystem @*/; + /*...@globals fileSystem, internalState @*/ + /*...@modifies wf, fileSystem, internalState @*/; rpmRC rpmwfInit(rpmwf wf, const char * fn, const char * fmode) - /*...@globals fileSystem @*/ - /*...@modifies wf, fileSystem @*/; + /*...@globals fileSystem, internalState @*/ + /*...@modifies wf, fileSystem, internalState @*/; rpmRC rpmwfPushRPM(rpmwf wf, const char * fn) /*...@globals fileSystem @*/ @@ -89,36 +89,38 @@ /*...@unused@*/ /*...@newref@*/ /*...@null@*/ rpmwf rpmwfLink (/*...@null@*/ rpmwf wf, /*...@null@*/ const char * msg) /*...@modifies wf @*/; -#define rpmwfLink(_wf, _msg) \ +#define rpmwfLink(_wf, _msg) \ ((rpmwf)rpmioLinkPoolItem((rpmioItem)(_wf), _msg, __FILE__, __LINE__)) /*...@null@*/ rpmwf rpmwfFree(/*...@only@*/ rpmwf wf) /*...@globals fileSystem @*/ /*...@modifies wf, fileSystem @*/; -#define rpmwfFree(_wf) \ +#define rpmwfFree(_wf) \ ((rpmwf)rpmioFreePoolItem((rpmioItem)(_wf), __FUNCTION__, __FILE__, __LINE__)) /*...@relnull@*/ rpmwf rpmwfNew(const char * fn) - /*...@globals fileSystem @*/ - /*...@modifies fileSystem @*/; + /*...@globals fileSystem, internalState @*/ + /*...@modifies fileSystem, internalState @*/; +/*...@relnull@*/ rpmwf rdRPM(const char * rpmfn) - /*...@globals fileSystem @*/ - /*...@modifies fileSystem @*/; + /*...@globals fileSystem, internalState @*/ + /*...@modifies fileSystem, internalState @*/; +/*...@relnull@*/ rpmwf rdXAR(const char * xarfn) - /*...@globals fileSystem @*/ - /*...@modifies fileSystem @*/; + /*...@globals fileSystem, internalState @*/ + /*...@modifies fileSystem, internalState @*/; rpmRC wrXAR(const char * xarfn, rpmwf wf) /*...@globals fileSystem @*/ /*...@modifies wf, fileSystem @*/; rpmRC wrRPM(const char * rpmfn, rpmwf wf) - /*...@globals fileSystem @*/ - /*...@modifies wf, fileSystem @*/; + /*...@globals fileSystem, internalState @*/ + /*...@modifies wf, fileSystem, internalState @*/; #ifdef __cplusplus @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/tagname.c ============================================================================ $ cvs diff -u -r1.28.2.3 -r1.28.2.4 tagname.c --- rpm/rpmdb/tagname.c 29 Mar 2009 02:24:23 -0000 1.28.2.3 +++ rpm/rpmdb/tagname.c 4 Apr 2009 18:57:12 -0000 1.28.2.4 @@ -21,8 +21,8 @@ */ static int tagLoadATags(/*...@null@*/ ARGV_t * argvp, int (*cmp) (const void * avp, const void * bvp)) - /*...@globals rpmGlobalMacroContext, h_errno @*/ - /*...@modifies *argvp, rpmGlobalMacroContext @*/ + /*...@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*...@modifies *argvp, rpmGlobalMacroContext, internalState @*/ { ARGV_t aTags = NULL; char * s = rpmExpand("%{?_arbitrary_tags}", NULL); @@ -157,14 +157,14 @@ /* forward refs */ static const char * _tagName(rpmTag tag) - /*...@globals rpmGlobalMacroContext, h_errno @*/ - /*...@modifies rpmGlobalMacroContext @*/; + /*...@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*...@modifies rpmGlobalMacroContext, internalState @*/; static unsigned int _tagType(rpmTag tag) - /*...@globals rpmGlobalMacroContext, h_errno @*/ - /*...@modifies rpmGlobalMacroContext @*/; + /*...@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*...@modifies rpmGlobalMacroContext, internalState @*/; static rpmTag _tagValue(const char * tagstr) - /*...@globals rpmGlobalMacroContext, h_errno @*/ - /*...@modifies rpmGlobalMacroContext @*/; + /*...@globals rpmGlobalMacroContext, h_errno, internalState @*/ + /*...@modifies rpmGlobalMacroContext, internalState @*/; /*...@unchecked@*/ static struct headerTagIndices_s _rpmTags = { @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org