Remove ancient, unused code to filter duplicates on rpmdb rebuild

- enabling this as-is would be murderous to multilib systems
- getting duplicates in the db would be a bug elsewhere
This commit is contained in:
Panu Matilainen
2009-09-22 09:26:39 +03:00
committed by Alexey Tourbin
parent 55ef8cfed5
commit afe7a56661
2 changed files with 3 additions and 34 deletions

View File

@ -48,7 +48,6 @@ static int _debug = 0;
/*@unchecked@*/
static int _rebuildinprogress = 0;
/*@unchecked@*/
static int _db_filter_dups = 0;
#define _DBI_FLAGS 0
#define _DBI_PERMS 0644
@ -883,17 +882,15 @@ static /*@only@*/ /*@null@*/
rpmdb newRpmdb(/*@kept@*/ /*@null@*/ const char * root,
/*@kept@*/ /*@null@*/ const char * home,
int mode, int perms, int flags)
/*@globals _db_filter_dups, rpmGlobalMacroContext @*/
/*@modifies _db_filter_dups, rpmGlobalMacroContext @*/
/*@globals rpmGlobalMacroContext @*/
/*@modifies rpmGlobalMacroContext @*/
{
rpmdb db = xcalloc(sizeof(*db), 1);
const char * epfx = _DB_ERRPFX;
static int _initialized = 0;
if (!_initialized) {
_db_filter_dups = rpmExpandNumeric("%{?_filterdbdups}");
if (!_initialized)
_initialized = 1;
}
/*@-assignexpose@*/
*db = dbTemplate; /* structure assignment */
@ -922,7 +919,6 @@ rpmdb newRpmdb(/*@kept@*/ /*@null@*/ const char * root,
db->db_errpfx = rpmExpand( (epfx && *epfx ? epfx : _DB_ERRPFX), NULL);
/*@=nullpass@*/
db->db_remove_env = 0;
db->db_filter_dups = _db_filter_dups;
db->db_ndbi = dbiTagsMax;
db->_dbi = xcalloc(db->db_ndbi, sizeof(*db->_dbi));
/*@-globstate@*/ return db; /*@=globstate@*/
@ -3356,32 +3352,6 @@ int rpmdbRebuild(const char * prefix)
continue;
}
/* Filter duplicate entries ? (bug in pre rpm-3.0.4) */
if (_db_filter_dups || newdb->db_filter_dups) {
const char * name, * version, * release;
int skip = 0;
(void) headerNVR(h, &name, &version, &release);
/*@-shadow@*/
{ rpmdbMatchIterator mi;
mi = rpmdbInitIterator(newdb, RPMTAG_NAME, name, 0);
(void) rpmdbSetIteratorRE(mi, RPMTAG_VERSION,
RPMMIRE_DEFAULT, version);
(void) rpmdbSetIteratorRE(mi, RPMTAG_RELEASE,
RPMMIRE_DEFAULT, release);
while (rpmdbNextIterator(mi)) {
skip = 1;
/*@innerbreak@*/ break;
}
mi = rpmdbFreeIterator(mi);
}
/*@=shadow@*/
if (skip)
continue;
}
/* Deleted entries are eliminated in legacy headers by copy. */
{ Header nh = (headerIsEntry(h, RPMTAG_HEADERIMAGE)
? headerCopy(h) : NULL);

View File

@ -311,7 +311,6 @@ struct rpmdb_s {
int db_api; /*!< Berkeley API type */
/*@owned@*/ const char * db_errpfx;
int db_remove_env;
int db_filter_dups;
int db_chrootDone; /*!< If chroot(2) done, ignore db_root. */
void (*db_errcall) (const char *db_errpfx, char *buffer)
/*@*/;