summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
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)
{