From 47bcec69ab346068a20892db2c819421607720d8 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 1 May 2025 13:40:12 +0900 Subject: [PATCH] clan_cli flake caching: fix caching of store files --- pkgs/clan-cli/clan_cli/flake.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/flake.py b/pkgs/clan-cli/clan_cli/flake.py index 58d16ec99..7bb53706d 100644 --- a/pkgs/clan-cli/clan_cli/flake.py +++ b/pkgs/clan-cli/clan_cli/flake.py @@ -344,9 +344,6 @@ class FlakeCacheEntry: def is_cached(self, selectors: list[Selector]) -> bool: selector: Selector - if selectors == []: - return self.fetched_all - selector = selectors[0] # for store paths we have to check if they still exist, otherwise they have to be rebuild and are thus not cached if isinstance(self.value, str) and self.value.startswith("/nix/store/"): @@ -356,6 +353,10 @@ class FlakeCacheEntry: if isinstance(self.value, str | float | int | None): return True + if selectors == []: + return self.fetched_all + selector = selectors[0] + # we just fetch all subkeys, so we need to check of we inserted all keys at this level before if selector.type == SelectorType.ALL: assert isinstance(self.value, dict)