From f637fa7746a0124cf38f4446beb93e53ceb991f2 Mon Sep 17 00:00:00 2001 From: dzaima Date: Wed, 25 Jan 2023 05:47:34 +0200 Subject: [PATCH] build.bqn: proper rule object --- build/src/build.bqn | 81 +++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/build/src/build.bqn b/build/src/build.bqn index 7317a88f..de2344d6 100755 --- a/build/src/build.bqn +++ b/build/src/build.bqn @@ -315,42 +315,36 @@ updateSubmodule ← { # gets/creates a directory of cacheable objects; key is the unique identifier of when it can be reused GetCache ← { 𝕊 basename‿desc‿key: - hash ⇐ Hash key - folder ⇐ allObjDir•file.At basename∾"-"∾hash + folderHash ⇐ Hash key + folder ⇐ allObjDir•file.At basename∾"-"∾folderHash MkDir AtRoot folder File ⇐ folder⊸•file.At {𝕊: desc∾": "∾AtRoot𝕩} _verboseLog folder dataPath ← AtRoot File "data" - prevKs‿prevVs ← •file.Exists◶⟨⟨⟩‿⟨⟩, {Deserialize ⟨8‿'c',8⟩•bit._cast •FBytes 𝕩}⟩ dataPath + dataVersion ← 0 + prevKs‿prevVs ← {a‿b: a≡dataVersion? b; ⟨⟩‿⟨⟩} •file.Exists◶⟨@, {Deserialize ⟨8‿'c',8⟩•bit._cast •FBytes 𝕩}⟩ dataPath IsUpToDate ⇐ { 𝕊: - i ← ⊑prevKs⊐<𝕩 + i ← ⊑prevKs⊐<𝕩.cacheKey i<≠prevKs? {@:0; ∧´ AtRoot⊸IsFileTheSame´¨𝕩} i⊑prevVs; 0 } newKs‿newVs ← ⟨⟩‿⟨⟩ - Update ⇐ {key𝕊data: newKs∾↩