diff --git a/.docker/install-forum.sh b/.docker/install-forum.sh index 8bc55700270..8f0fd02da57 100755 --- a/.docker/install-forum.sh +++ b/.docker/install-forum.sh @@ -75,6 +75,19 @@ install_one() { return 0 fi + # The installer checks every file against the manifest, and the entrypoint + # builds that manifest from the checkout only when there is none. One built + # before the checkout was last edited would fail the check, so a manifest + # that is not part of HEAD is removed here, from the index too if it was + # staged. When reset.sh restarts the container the entrypoint builds a fresh + # one, or leaves it absent on a dirty working tree, which a development + # version's installer accepts. + if git rev-parse --is-inside-work-tree >/dev/null 2>&1 \ + && ! git cat-file -e HEAD:Sources/Maintenance/manifest.php 2>/dev/null; then + git rm -q --cached --ignore-unmatch Sources/Maintenance/manifest.php + rm -f Sources/Maintenance/manifest.php + fi + log "${smf_type}: resetting" "$DOCKER_DIR/reset.sh" --engine "$smf_type" >/dev/null diff --git a/Sources/Maintenance/Tools/Install.php b/Sources/Maintenance/Tools/Install.php index 4ae4b1e426d..3b879913193 100644 --- a/Sources/Maintenance/Tools/Install.php +++ b/Sources/Maintenance/Tools/Install.php @@ -255,8 +255,9 @@ public function getStepTitle(): string */ public function welcome(): bool { - // Done the submission? - if (isset($_POST['contbutt'])) { + // Done the submission? From the command line contbutt is passed with every + // run, so there it cannot mean the checks below were seen and passed. + if (isset($_POST['contbutt']) && !Sapi::isCLI()) { // Does the admin want debug info? $this->debug = isset($_POST['debug']); @@ -362,6 +363,11 @@ public function welcome(): bool Utils::$context['continue'] = true; } + // There is no page to show on the command line, so carry on unless a check failed. + if (Sapi::isCLI()) { + return empty(Maintenance::$errors) && empty(Maintenance::$fatal_error); + } + return false; }