sqlite3-backend: move dbs to repository_dir with distromatic.db name

This commit is contained in:
Silvan Calarco 2013-10-07 15:35:57 +02:00
parent 7a727bfa46
commit 93f7fc1233
2 changed files with 2 additions and 2 deletions

View File

@ -461,7 +461,7 @@ generateSQLite(struct configTag *ct)
char dbname[PATH_MAX];
int i;
snprintf(dbname, PATH_MAX, "%s%s.db", ct->configdefaults->html_basedir, ct->tag);
snprintf(dbname, PATH_MAX, "%sdistromatic.db", ct->repository_dir);
unlink(dbname);
if (sqlite3_open_v2(dbname, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL)) {

View File

@ -104,7 +104,7 @@ void printQueryData(char* repository_tag, char* query) {
char dbname[PATH_MAX];
for (i = 0; i <= configtag->repository_level; i++) {
snprintf(dbname, PATH_MAX, "%s%s.db", configtag->configdefaults->html_basedir, configtag->repository[i]->tag);
snprintf(dbname, PATH_MAX, "%sdistromatic.db", configtag->repository[i]->repository_dir);
if (sqlite3_open_v2(dbname, (sqlite3**)&configtag->repository[i]->db, SQLITE_OPEN_READONLY, NULL)) {
if (configtag->repository[i]->db) sqlite3_close(configtag->repository[i]->db);
fprintf(stderr, "ERROR: unable to open sqlite3 db %s; aborting.\n", dbname);