rpm/rpm-4.7.1-chroot-env-paths.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
870 B
Diff

diff --git a/lib/backend/db3.c b/lib/backend/db3.c
index 9f0f941..b0b2a86 100644
--- a/lib/backend/db3.c
+++ b/lib/backend/db3.c
@@ -1015,17 +1015,12 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
}
if (rc == 0) {
- char * fullpath;
- const char * dbpath;
- fullpath = rpmGetPath(dbhome, "/", dbfile ? dbfile : "", NULL);
-
-#ifdef HACK /* XXX necessary to support dbsubfile */
- dbpath = (!dbi->dbi_use_dbenv && !dbi->dbi_temporary)
- ? fullpath : dbfile;
-#else
- dbpath = (!dbi->dbi_temporary)
- ? fullpath : dbfile;
-#endif
+ char * fullpath = NULL;
+ const char * dbpath = dbfile;
+ if (!dbi->dbi_use_dbenv && !dbi->dbi_temporary) {
+ fullpath = rpmGetPath(dbhome, "/", dbfile, NULL);
+ dbpath = fullpath;
+ }
rc = (db->open)(db, txnid, dbpath, dbsubfile,
dbi->dbi_type, oflags, dbi->dbi_perms);