From 54c12759eecf059921d0bee59af371bfb94d221b Mon Sep 17 00:00:00 2001 From: Disassembler Date: Mon, 13 Apr 2020 21:26:11 +0200 Subject: [PATCH] Ensure that spoc-app installs layers in correct order, closes #1 --- usr/bin/spoc-app | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/bin/spoc-app b/usr/bin/spoc-app index 22c56ce..3658f96 100755 --- a/usr/bin/spoc-app +++ b/usr/bin/spoc-app @@ -34,7 +34,8 @@ def install(app_name): for container in repo_online.get_app(app_name)['containers'].values(): required_images.extend(repo_online.get_image(container['image'])['layers']) local_images = repo_local.get_images() - for layer in set(required_images): + # Layers need to be downloaded in correct order + for layer in list(dict.fromkeys(required_images)): if layer not in local_images: queue.download_image(Image(layer, False)) queue.install_app(App(app_name, False, False)) @@ -48,7 +49,8 @@ def update(app_name): for container in repo_online.get_app(app_name)['containers'].values(): required_images.extend(repo_online.get_image(container['image'])['layers']) local_images = repo_local.get_images() - for layer in set(required_images): + # Layers need to be downloaded in correct order + for layer in list(dict.fromkeys(required_images)): if layer not in local_images: queue.download_image(Image(layer, False)) queue.update_app(App(app_name, False))