From dff73774ca68b1ab79534547fc744c510da8f0e5 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 22 Sep 2009 09:26:39 +0300 Subject: [PATCH] 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 --- lib/rpmdb.c | 27 --------------------------- lib/rpmdb_internal.h | 1 - 2 files changed, 28 deletions(-) diff --git a/lib/rpmdb.c b/lib/rpmdb.c index 9b398e2..f15c446 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -35,7 +35,6 @@ int _rpmdb_debug = 0; static int _rebuildinprogress = 0; -static int _db_filter_dups = 0; #define _DBI_FLAGS 0 #define _DBI_PERMS 0644 @@ -911,7 +910,6 @@ rpmdb newRpmdb(const char * root, static int _initialized = 0; if (!_initialized) { - _db_filter_dups = rpmExpandNumeric("%{_filterdbdups}"); _initialized = 1; } @@ -937,7 +935,6 @@ rpmdb newRpmdb(const char * root, db->db_errpfx = rpmExpand( (epfx && *epfx ? epfx : _DB_ERRPFX), NULL); /* XXX remove environment after chrooted operations, for now... */ db->db_remove_env = (!rstreq(db->db_root, "/") ? 1 : 0); - db->db_filter_dups = _db_filter_dups; db->db_ndbi = dbiTags.max; db->db_malloc = rmalloc; db->db_realloc = rrealloc; @@ -3233,30 +3230,6 @@ int rpmdbRebuild(const char * prefix, rpmts ts, continue; } - /* Filter duplicate entries ? (bug in pre rpm-3.0.4) */ - if (_db_filter_dups || newdb->db_filter_dups) { - const char *name = headerGetString(h, RPMTAG_NAME); - const char *version = headerGetString(h, RPMTAG_VERSION); - const char *release = headerGetString(h, RPMTAG_RELEASE); - int skip = 0; - - { 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; - break; - } - mi = rpmdbFreeIterator(mi); - } - - if (skip) - continue; - } - /* Deleted entries are eliminated in legacy headers by copy. */ { Header nh = (headerIsEntry(h, RPMTAG_HEADERIMAGE) ? headerCopy(h) : NULL); diff --git a/lib/rpmdb_internal.h b/lib/rpmdb_internal.h index 3e90e47..7f5a158 100644 --- a/lib/rpmdb_internal.h +++ b/lib/rpmdb_internal.h @@ -263,7 +263,6 @@ struct rpmdb_s { int db_api; /*!< Berkeley API type */ char * db_errpfx; int db_remove_env; - int db_filter_dups; int db_chrootDone; /*!< If chroot(2) done, ignore db_root. */ int db_mkdirDone; /*!< Has db_home been created? */ void (*db_errcall) (const char *db_errpfx, char *buffer); -- 2.7.4