rpm/rpm-4.7.1-chroot-remove-env.patch
Panu Matilainen e0a8ab7463 - use relative paths within db environment (related to #507309, #507309...)
- remove db environment on close in chrooted operation (related to above)
- initialize rpmlib earlier in rpm2cpio (#523260)
- fix file dependency tag extension formatting (#523282)
2009-09-21 13:25:25 +00:00

29 lines
1.1 KiB
Diff

diff --git a/lib/backend/db3.c b/lib/backend/db3.c
index 9f0f941..9683100 100644
--- a/lib/backend/db3.c
+++ b/lib/backend/db3.c
@@ -181,7 +181,8 @@ static int db_fini(dbiIndex dbi, const char * dbhome,
xx = db_env_create(&dbenv, 0);
xx = cvtdberr(dbi, "db_env_create", xx, _debug);
xx = dbenv->remove(dbenv, dbhome, 0);
- xx = cvtdberr(dbi, "dbenv->remove", xx, _debug);
+ /* filter out EBUSY as it just means somebody else gets to clean it */
+ xx = cvtdberr(dbi, "dbenv->remove", xx, (xx == EBUSY ? 0 : _debug));
if (dbfile)
rpmlog(RPMLOG_DEBUG, "removed db environment %s/%s\n",
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
index 0754b99..b781cfc 100644
--- a/lib/rpmdb.c
+++ b/lib/rpmdb.c
@@ -921,7 +921,8 @@ rpmdb newRpmdb(const char * root,
return NULL;
}
db->db_errpfx = rpmExpand( (epfx && *epfx ? epfx : _DB_ERRPFX), NULL);
- db->db_remove_env = 0;
+ /* XXX remove environment after chrooted operations, for now... */
+ db->db_remove_env = ((strcmp(db->db_root, "/") != 0)? 1 : 0);
db->db_filter_dups = _db_filter_dups;
db->db_ndbi = dbiTags.max;
db->_dbi = xcalloc(db->db_ndbi, sizeof(*db->_dbi));