summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-22 20:47:21 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-22 20:47:21 +0300
commit718ef3079ea18fcb588264d26e3316628ad18ba0 (patch)
tree7a945f9ad7510096854bb2f599271b7a73aafa95 /src/database.c
parent9b77c053e8fd03348ed04ba09ceaaf7ba99ca6f6 (diff)
downloadapk-tools-718ef3079ea18fcb588264d26e3316628ad18ba0.tar.gz
apk-tools-718ef3079ea18fcb588264d26e3316628ad18ba0.tar.bz2
apk-tools-718ef3079ea18fcb588264d26e3316628ad18ba0.tar.xz
apk-tools-718ef3079ea18fcb588264d26e3316628ad18ba0.zip
add: fixes to installing non-repository package
make sure cache is enabled on non-permanent rootfs setups. some optimizations and fixes too.
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/database.c b/src/database.c
index b27df99..e171ca9 100644
--- a/src/database.c
+++ b/src/database.c
@@ -941,6 +941,17 @@ int apk_db_cache_active(struct apk_database *db)
return db->cache_dir != apk_static_cache_dir;
}
+int apk_db_permanent(struct apk_database *db)
+{
+ struct stat st;
+
+ if (fstat(db->root_fd, &st) != 0)
+ return 0;
+ if (major(st.st_dev) == 0)
+ return 0;
+ return 1;
+}
+
struct apk_package *apk_db_get_pkg(struct apk_database *db,
struct apk_checksum *csum)
{