summaryrefslogtreecommitdiff
path: root/lib/backend
diff options
context:
space:
mode:
Diffstat (limited to 'lib/backend')
-rw-r--r--lib/backend/db3.c6
-rw-r--r--lib/backend/dbi.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/lib/backend/db3.c b/lib/backend/db3.c
index 66ba16064..bcdebea48 100644
--- a/lib/backend/db3.c
+++ b/lib/backend/db3.c
@@ -578,6 +578,12 @@ int dbiOpen(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
*/
if (oflags & DB_RDONLY)
dbi->dbi_verify_on_close = 0;
+
+ /* Any indexes created here mean we'll need an index rebuild */
+ if (dbiType(dbi) == DBI_SECONDARY && (oflags & DB_CREATE)) {
+ rpmlog(RPMLOG_DEBUG, "index %s needs creating\n", dbi->dbi_file);
+ rpmdb->db_buildindex++;
+ }
dbi->dbi_db = db;
dbi->dbi_oflags = oflags;
diff --git a/lib/backend/dbi.h b/lib/backend/dbi.h
index dd1ada6a9..6cb20d879 100644
--- a/lib/backend/dbi.h
+++ b/lib/backend/dbi.h
@@ -22,6 +22,7 @@ struct rpmdb_s {
void * db_dbenv; /*!< Berkeley DB_ENV handle. */
int db_ndbi; /*!< No. of tag indices. */
dbiIndex * _dbi; /*!< Tag indices. */
+ int db_buildindex; /*!< Index rebuild indicator */
struct rpmop_s db_getops;
struct rpmop_s db_putops;