summaryrefslogtreecommitdiff
path: root/src/database.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2022-02-06 21:08:09 +0200
committerTimo Teräs <timo.teras@iki.fi>2022-02-21 10:24:05 +0200
commitf69ae302722d5792bc99292112abc06e1ba216c7 (patch)
tree38a30313e26ad8406aaed396f4597d34adaa89eb /src/database.c
parent9089edcc44fe12003f9d13d5868fa26b2e980a18 (diff)
downloadapk-tools-f69ae302722d5792bc99292112abc06e1ba216c7.tar.gz
apk-tools-f69ae302722d5792bc99292112abc06e1ba216c7.tar.bz2
apk-tools-f69ae302722d5792bc99292112abc06e1ba216c7.tar.xz
apk-tools-f69ae302722d5792bc99292112abc06e1ba216c7.zip
db: sort world dependencies to layers
Diffstat (limited to 'src/database.c')
-rw-r--r--src/database.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/database.c b/src/database.c
index 781cf99..1e674d7 100644
--- a/src/database.c
+++ b/src/database.c
@@ -1819,11 +1819,16 @@ static int apk_db_write_layers(struct apk_database *db)
ld->installed = apk_ostream_to_file(ld->fd, "installed", 0644);
ld->scripts = apk_ostream_to_file(ld->fd, "scripts.tar", 0644);
ld->triggers = apk_ostream_to_file(ld->fd, "triggers", 0644);
- }
- os = apk_ostream_to_file(db->root_fd, apk_world_file, 0644);
- if (!IS_ERR(os)) {
- apk_deps_write(db, db->world, os, APK_BLOB_PTR_LEN("\n", 1));
+ if (i == 0)
+ os = apk_ostream_to_file(db->root_fd, apk_world_file, 0644);
+ else
+ os = apk_ostream_to_file(ld->fd, "world", 0644);
+ if (IS_ERR(os)) {
+ if (!rr) rr = PTR_ERR(os);
+ continue;
+ }
+ apk_deps_write_layer(db, db->world, os, APK_BLOB_PTR_LEN("\n", 1), i);
apk_ostream_write(os, "\n", 1);
r = apk_ostream_close(os);
if (!rr) rr = r;