diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-04-21 08:51:18 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-04-21 08:51:18 +0000 |
commit | 74b5e4f5350e6899bbf8e2ff6c7e4ecba17c3d9c (patch) | |
tree | 7d9456860dade73a8bb8e61d84d97b1040de3f36 /src/database.c | |
parent | 64e0adf0c7609e30c76ec190ec843311c956f862 (diff) | |
download | apk-tools-74b5e4f5350e6899bbf8e2ff6c7e4ecba17c3d9c.tar.gz apk-tools-74b5e4f5350e6899bbf8e2ff6c7e4ecba17c3d9c.tar.bz2 apk-tools-74b5e4f5350e6899bbf8e2ff6c7e4ecba17c3d9c.tar.xz apk-tools-74b5e4f5350e6899bbf8e2ff6c7e4ecba17c3d9c.zip |
db: do not assume root ends with '/'
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/database.c b/src/database.c index a9cdae7..94fc3a0 100644 --- a/src/database.c +++ b/src/database.c @@ -906,7 +906,7 @@ static struct apk_bstream *apk_db_cache_open(struct apk_database *db, if (db->root == NULL) return NULL; - snprintf(tmp, sizeof(tmp), "%svar/lib/apk/%s", db->root, file); + snprintf(tmp, sizeof(tmp), "%s/var/lib/apk/%s", db->root, file); return apk_bstream_from_file(tmp); } @@ -919,7 +919,7 @@ static int apk_db_cache_has(struct apk_database *db, const char *file) if (db->root == NULL) return FALSE; - snprintf(tmp, sizeof(tmp), "%svar/lib/apk/%s", db->root, file); + snprintf(tmp, sizeof(tmp), "%s/var/lib/apk/%s", db->root, file); r = apk_file_get_info(tmp, &fi); if (r < 0) return FALSE; @@ -948,13 +948,13 @@ int apk_repository_update(struct apk_database *db, struct apk_repository *repo) apk_message("fetch index %s", repo->url); snprintf(tmp, sizeof(tmp), "%s/APK_INDEX.gz", repo->url); - snprintf(tmp2, sizeof(tmp2), "%svar/lib/apk/%s.new", + snprintf(tmp2, sizeof(tmp2), "%s/var/lib/apk/%s.new", db->root, repo->cache); r = apk_url_download(tmp, tmp2); if (r < 0) return r; - snprintf(tmp, sizeof(tmp), "%svar/lib/apk/%s", + snprintf(tmp, sizeof(tmp), "%s/var/lib/apk/%s", db->root, repo->cache); if (rename(tmp2, tmp) < 0) return -errno; |