#include <rpm/rpmtag.h>
#include <rpm/rpmmacro.h>
-#include <rpm/rpmurl.h> /* XXX urlPath proto */
#include <rpm/rpmfileutil.h> /* rpmioMkPath */
#include <rpm/rpmlog.h>
static int db3close(dbiIndex dbi, unsigned int flags)
{
rpmdb rpmdb = dbi->dbi_rpmdb;
- char * urlfn = NULL;
const char * root;
const char * home;
- const char * dbhome;
+ char * dbhome;
const char * dbfile;
const char * dbsubfile;
DB * db = dbi->dbi_db;
root = NULL;
home = (dbi->dbi_home ? dbi->dbi_home : rpmdb->db_home);
- /*
- * Either the root or directory components may be a URL. Concatenate,
- * convert the URL to a path, and add the name of the file.
- */
- urlfn = rpmGenPath(root, home, NULL);
- (void) urlPath(urlfn, &dbhome);
+ dbhome = rpmGenPath(root, home, NULL);
if (dbi->dbi_temporary) {
dbfile = NULL;
dbsubfile = NULL;
exit:
dbi->dbi_db = NULL;
- urlfn = _free(urlfn);
+ free(dbhome);
dbi = db3Free(dbi);
static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
{
extern const struct _dbiVec db3vec;
- char * urlfn = NULL;
const char * root;
const char * home;
- const char * dbhome;
+ char * dbhome;
const char * dbfile;
const char * dbsubfile;
dbiIndex dbi = NULL;
root = NULL;
home = (dbi->dbi_home ? dbi->dbi_home : rpmdb->db_home);
- /*
- * Either the root or directory components may be a URL. Concatenate,
- * convert the URL to a path, and add the name of the file.
- */
- urlfn = rpmGenPath(root, home, NULL);
- (void) urlPath(urlfn, &dbhome);
+ dbhome = rpmGenPath(root, home, NULL);
if (dbi->dbi_temporary) {
dbfile = NULL;
dbsubfile = NULL;
(void) db3close(dbi, 0);
}
- urlfn = _free(urlfn);
+ free(dbhome);
return rc;
}
if (perms >= 0) db->db_perms = perms;
if (flags >= 0) db->db_flags = flags;
- /* HACK: no URL's for root prefixed dbpath yet. */
if (root && *root) {
- const char * rootpath = NULL;
- urltype ut = urlPath(root, &rootpath);
- switch (ut) {
- case URL_IS_PATH:
- case URL_IS_UNKNOWN:
- db->db_root = rpmGetPath(root, NULL);
- break;
- case URL_IS_HTTPS:
- case URL_IS_HTTP:
- case URL_IS_FTP:
- case URL_IS_HKP:
- case URL_IS_DASH:
- default:
- db->db_root = rpmGetPath(_DB_ROOT, NULL);
- break;
- }
+ db->db_root = rpmGetPath(root, NULL);
} else
db->db_root = rpmGetPath(_DB_ROOT, NULL);
+
db->db_home = rpmGetPath( (home && *home ? home : _DB_HOME), NULL);
if (!(db->db_home && db->db_home[0] != '%')) {
rpmlog(RPMLOG_ERR, _("no dbpath has been set\n"));
#include <rpm/rpmtag.h>
#include <rpm/rpmlog.h>
#include <rpm/rpmmacro.h>
-#include <rpm/rpmurl.h> /* XXX urlPath proto */
#include <rpm/rpmfileutil.h> /* rpmioMkpath */
#include <rpm/rpmstring.h>
#include <rpm/rpmdb.h>
{
extern const struct _dbiVec sqlitevec;
- char * urlfn = NULL;
char * root;
char * home;
- const char * dbhome;
+ char * dbhome;
const char * dbfile;
char * dbfname;
const char * sql_errcode;
dbi->dbi_mode=O_RDWR;
- /*
- * Either the root or directory components may be a URL. Concatenate,
- * convert the URL to a path, and add the name of the file.
- */
- urlfn = rpmGenPath(NULL, home, NULL);
- (void) urlPath(urlfn, &dbhome);
+ dbhome = rpmGenPath(NULL, home, NULL);
/*
* Create the /var/lib/rpm directory if it doesn't exist (root only).
(void) sql_close(dbi, 0);
}
- urlfn = _free(urlfn);
+ free(dbhome);
dbfname = _free(dbfname);
leaveChroot(dbi);