Skip to content

Commit fc5bee8

Browse files
committed
refactor(provisioning): 闸不再多套一层缩进
把 `have != want` 换成一个 `needProvision` 布尔,于是自动安装闸可以在供给块**之前** 求值并在采信旧记号时把它关掉 —— 供给块本身保持原来的嵌套层级。行为不变;改的是让 一个千行的 PR 里这一段仍然读得下去。
1 parent 8fc9328 commit fc5bee8

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/build/prepare.cppm

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3312,10 +3312,8 @@ prepare_build(bool print_fingerprint,
33123312
legacy.assign(std::istreambuf_iterator<char>(in), {});
33133313
return legacy == want;
33143314
};
3315-
if (have != want) {
3316-
// Set by the gate below when a legacy stamp lets an
3317-
// offline build proceed without an attempt.
3318-
bool provisioned = false;
3315+
bool needProvision = (have != want);
3316+
if (needProvision) {
33193317
// ⚠️ THE AUTO-INSTALL GATE, WHICH THIS PATH DID NOT HAVE.
33203318
//
33213319
// `[toolchain]` is the precedent this whole mechanism cites
@@ -3369,9 +3367,10 @@ prepare_build(bool print_fingerprint,
33693367
// Deliberately NOT writing the registry stamp: nothing
33703368
// here verified anything, and a record of a check that
33713369
// did not happen is the defect this release removes.
3372-
provisioned = true;
3370+
needProvision = false;
33733371
}
3374-
if (!provisioned) {
3372+
}
3373+
if (needProvision) {
33753374
mcpp::ui::status("Provisioning",
33763375
std::format("[xlings] deps ({})",
33773376
join_deps(", ")));
@@ -3473,7 +3472,6 @@ prepare_build(bool print_fingerprint,
34733472
std::error_code sec;
34743473
std::filesystem::create_directories(stamp.parent_path(), sec);
34753474
if (std::ofstream out{stamp}; out) out << want;
3476-
} // if (!provisioned)
34773475
}
34783476
}
34793477

0 commit comments

Comments
 (0)