xx = cvtdberr(dbi, "dbenv->set_mp_mmapsize", xx, _debug);
}
if (dbi->dbi_tmpdir) {
- const char * root;
- char * tmpdir;
-
- root = rpmdb->db_root;
- if (rstreq(root, "/") || rpmdb->db_chrootDone)
- root = NULL;
- tmpdir = rpmGenPath(root, dbi->dbi_tmpdir, NULL);
+ const char * root = rpmdb->db_chrootDone ? NULL : rpmdb->db_root;
+ char * tmpdir = rpmGenPath(root, dbi->dbi_tmpdir, NULL);
xx = dbenv->set_tmp_dir(dbenv, tmpdir);
xx = cvtdberr(dbi, "dbenv->set_tmp_dir", xx, _debug);
tmpdir = _free(tmpdir);
static int db3close(dbiIndex dbi, unsigned int flags)
{
rpmdb rpmdb = dbi->dbi_rpmdb;
- const char * root;
- const char * home;
+ const char * root = rpmdb->db_chrootDone ? NULL : rpmdb->db_root;
char * dbhome;
const char * dbfile;
DB * db = dbi->dbi_db;
/*
* Get the prefix/root component and directory path.
*/
- root = rpmdb->db_root;
- if (rstreq(root, "/") || rpmdb->db_chrootDone)
- root = NULL;
- home = rpmdb->db_home;
-
- dbhome = rpmGenPath(root, home, NULL);
+ dbhome = rpmGenPath(root, rpmdb->db_home, NULL);
if (dbi->dbi_temporary) {
dbfile = NULL;
} else {
static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
{
extern const struct _dbiVec db3vec;
- const char * root;
- const char * home;
+ const char * root = rpmdb->db_chrootDone ? NULL : rpmdb->db_root;
char * dbhome;
const char * dbfile;
dbiIndex dbi = NULL;
/*
* Get the prefix/root component and directory path.
*/
- root = rpmdb->db_root;
- if (rstreq(root, "/") || rpmdb->db_chrootDone)
- root = NULL;
- home = rpmdb->db_home;
-
- dbhome = rpmGenPath(root, home, NULL);
+ dbhome = rpmGenPath(root, rpmdb->db_home, NULL);
if (dbi->dbi_temporary) {
dbfile = NULL;
} else {
{
extern const struct _dbiVec sqlitevec;
- char * root;
- char * home;
char * dbhome;
const char * dbfile;
char * dbfname;
if ((dbi = db3New(rpmdb, rpmtag)) == NULL)
return 1;
- /*
- * Get the prefix/root component and directory path
- */
- root = rpmdb->db_root;
- home = rpmdb->db_home;
-
dbfile = rpmTagGetName(dbi->dbi_rpmtag);
enterChroot(dbi);
dbi->dbi_mode=O_RDWR;
- dbhome = rpmGenPath(NULL, home, NULL);
+ dbhome = rpmGenPath(NULL, rpmdb->db_home, NULL);
/*
* Create the /var/lib/rpm directory if it doesn't exist (root only).