Skip to content

install: preserve errexit during fork detection - #3

Merged
soulteary merged 1 commit into
mainfrom
codex/feat/fork-detection
Oct 5, 2026
Merged

soulteary merged 1 commit into
mainfrom
codex/feat/fork-detection

Conversation

@soulteary

Copy link
Copy Markdown
Owner

Summary

Use the exit status of lsb_release -a -u directly in check_forked() instead of temporarily disabling and then unconditionally enabling errexit.

An unsupported -u option still enters the existing fallback. A successful probe still resolves the same upstream distribution and codename. The probe now preserves the caller's shell options.

Changes

  • Replace the set +e / saved exit status / set -e sequence with a conditional command.
  • Retain the existing distribution mappings, output and fallback paths.

Related upstream proposal: docker#173. This is a focused implementation against this fork's current main.

Validation

  • sh -n, dash -n and bash -n pass for install.sh.
  • ShellCheck 0.11.0 passes for both source scripts using the repository's existing exclusions.
  • Generated stable/test installers and the stable rootless installer pass ShellCheck through the existing Makefile, with explicit STABLE_LATEST=29.4.2 and TEST_LATEST=29.4.2 validation values.
  • 24 temporary, offline fixture checks pass across sh, dash and Bash: supported upstream detection, unsupported upstream detection, missing lsb_release, and Debian fallback, each with caller errexit enabled and disabled.
  • The unchanged main implementation reproduces unwanted errexit enablement in all three shells when the caller has it disabled.
  • git diff --check passes.

The fixtures exercise the extracted detection function and mocked OS data; they are not installation tests on those distributions. No package installation or service-start test was performed for this control-flow-only change.

Contribution

The commit includes a Signed-off-by trailer. This PR targets soulteary/docker-install:main.

A separate branch starts at the current upsteam commit and contains only this change: https://github.com/docker/docker-install/compare/master...soulteary:codex/feat/fork-detection-upstream?expand=1 . The comparison is provided for manual upstream submission; no upstream PR was created.

Use the upstream probe directly as a conditional command so unsupported options follow the existing fallback without changing caller shell options.

Inspired by docker#173.

Signed-off-by: Su Yang <soulteary@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T11:57:08.971534Z 68f46d7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@soulteary

Copy link
Copy Markdown
Owner Author

from docker#173

@soulteary
soulteary merged commit 3f90708 into main Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant