rpm/rpm-4.9.0-beta1-env-noremove.patch
Panu Matilainen 5430e272b0 - dont try to remove environment files if private env used (related to #671200)
- unbreak mono dependency extraction (#673663)
- complain instead of silent abort if cwd is not readable (#672576)
2011-01-31 10:14:23 +02:00

35 lines
1.0 KiB
Diff

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