if (r)
goto END;
+ // Create the parent directory
+ r = pakfire_mkparentdir(o->path, 0755);
+ if (r < 0)
+ goto END;
+
// Try to open the sqlite3 database file
r = sqlite3_open_v2(o->path, &o->handle, sqlite3_flags, NULL);
if (r != SQLITE_OK) {
PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, struct pakfire_ctx* ctx,
const char* path, const char* arch, FILE* conf, int flags) {
struct pakfire* p = NULL;
- char private_dir[PATH_MAX];
int r;
// Default to the native architecture
if (*p->distro.slogan)
CTX_DEBUG(p->ctx, " slogan = %s\n", p->distro.slogan);
- // Make path for private files
- r = pakfire_path(p, private_dir, "%s", PAKFIRE_PRIVATE_DIR);
- if (r)
- goto ERROR;
-
- // Make sure that our private directory exists
- r = pakfire_mkdir(private_dir, 0755);
- if (r) {
- CTX_ERROR(p->ctx, "Could not create private directory %s: %m\n", private_dir);
- goto ERROR;
- }
-
// Bump RLIMIT_NOFILE to maximum
r = pakfire_rlimit_set(p, PAKFIRE_RLIMIT_NOFILE_MAX);
if (r)