Blame rpm-4.9.0-beta1-env-noremove.patch
|
Panu Matilainen |
5430e2 |
commit 0ee494ea672b9125171098184c702ccc3dd0163e
|
|
Panu Matilainen |
5430e2 |
Author: Panu Matilainen <pmatilai@redhat.com>
|
|
Panu Matilainen |
5430e2 |
Date: Fri Jan 21 15:20:01 2011 +0200
|
|
Panu Matilainen |
5430e2 |
|
|
Panu Matilainen |
5430e2 |
Don't try to remove existing environment when using private environment
|
|
Panu Matilainen |
5430e2 |
(cherry picked from commit 88e63b050cfd3ba28cb44e75b3ac31fdf5fe9909)
|
|
Panu Matilainen |
5430e2 |
|
|
Panu Matilainen |
5430e2 |
diff --git a/lib/backend/db3.c b/lib/backend/db3.c
|
|
Panu Matilainen |
5430e2 |
index 365cd13..da1b602 100644
|
|
Panu Matilainen |
5430e2 |
--- a/lib/backend/db3.c
|
|
Panu Matilainen |
5430e2 |
+++ b/lib/backend/db3.c
|
|
Panu Matilainen |
5430e2 |
@@ -51,6 +51,7 @@ static int db_fini(rpmdb rdb, const char * dbhome)
|
|
Panu Matilainen |
5430e2 |
{
|
|
Panu Matilainen |
5430e2 |
DB_ENV * dbenv = rdb->db_dbenv;
|
|
Panu Matilainen |
5430e2 |
int rc;
|
|
Panu Matilainen |
5430e2 |
+ uint32_t eflags = 0;
|
|
Panu Matilainen |
5430e2 |
|
|
Panu Matilainen |
5430e2 |
if (dbenv == NULL)
|
|
Panu Matilainen |
5430e2 |
return 0;
|
|
Panu Matilainen |
5430e2 |
@@ -60,12 +61,13 @@ static int db_fini(rpmdb rdb, const char * dbhome)
|
|
Panu Matilainen |
5430e2 |
return 0;
|
|
Panu Matilainen |
5430e2 |
}
|
|
Panu Matilainen |
5430e2 |
|
|
Panu Matilainen |
5430e2 |
+ (void) dbenv->get_open_flags(dbenv, &eflags);
|
|
Panu Matilainen |
5430e2 |
rc = dbenv->close(dbenv, 0);
|
|
Panu Matilainen |
5430e2 |
rc = dbapi_err(rdb, "dbenv->close", rc, _debug);
|
|
Panu Matilainen |
5430e2 |
|
|
Panu Matilainen |
5430e2 |
rpmlog(RPMLOG_DEBUG, "closed db environment %s\n", dbhome);
|
|
Panu Matilainen |
5430e2 |
|
|
Panu Matilainen |
5430e2 |
- if (rdb->db_remove_env) {
|
|
Panu Matilainen |
5430e2 |
+ if (!(eflags & DB_PRIVATE) && rdb->db_remove_env) {
|
|
Panu Matilainen |
5430e2 |
int xx;
|
|
Panu Matilainen |
5430e2 |
|
|
Panu Matilainen |
5430e2 |
xx = db_env_create(&dbenv, 0);
|