summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-07-02 09:50:16 +0300
committerTimo Teräs <timo.teras@iki.fi>2015-07-02 09:56:50 +0300
commit57de8d0c5de43dd8c1d7b76a429b34a7e5ddd7b0 (patch)
treefae0470cfbdcd482272eac33ff2fc89cc636c03c /src
parent68453b99e68e8bc8454956cdcbbf6d0a520d666f (diff)
downloadapk-tools-57de8d0c5de43dd8c1d7b76a429b34a7e5ddd7b0.tar.gz
apk-tools-57de8d0c5de43dd8c1d7b76a429b34a7e5ddd7b0.tar.bz2
apk-tools-57de8d0c5de43dd8c1d7b76a429b34a7e5ddd7b0.tar.xz
apk-tools-57de8d0c5de43dd8c1d7b76a429b34a7e5ddd7b0.zip
relocate lock file to /lib/apk/db
the problem is that var/lock is on root installs symlink to /run/lock (on tmpfs) and does not exist if doing chroot() to that root. fixes apk to work when chrooted to existing rootfs install.
Diffstat (limited to 'src')
-rw-r--r--src/database.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/database.c b/src/database.c
index 7a9ab58..b485004 100644
--- a/src/database.c
+++ b/src/database.c
@@ -53,12 +53,12 @@ static const char * const apkindex_tar_gz = "APKINDEX.tar.gz";
static const char * const apk_static_cache_dir = "var/cache/apk";
static const char * const apk_linked_cache_dir = "etc/apk/cache";
-static const char * const apk_lock_file = "var/lock/apkdb";
-
static const char * const apk_world_file = "etc/apk/world";
static const char * const apk_world_file_tmp = "etc/apk/world.new";
static const char * const apk_arch_file = "etc/apk/arch";
+static const char * const apk_lock_file = "lib/apk/db/lock";
+
static const char * const apk_scripts_file = "lib/apk/db/scripts.tar";
static const char * const apk_scripts_file_tmp = "lib/apk/db/scripts.tar.new";
@@ -1327,7 +1327,6 @@ static int apk_db_create(struct apk_database *db)
mkdirat(db->root_fd, "var/cache", 0755);
mkdirat(db->root_fd, "var/cache/apk", 0755);
mkdirat(db->root_fd, "var/cache/misc", 0755);
- mkdirat(db->root_fd, "var/lock", 0755);
fd = openat(db->root_fd, apk_world_file, O_CREAT|O_RDWR|O_TRUNC|O_CLOEXEC, 0644);
if (fd < 0)