Skip to content

Homebrew install logic (pinned + mutable, curl+bash, SHA-256 verify) duplicated nearly verbatim across three entry points #1888

Description

@codeforester

Summary

The same pinned-vs-mutable Homebrew install decision tree is implemented three separate times.

Details

  • install.sh:206-249 (install_homebrew)
  • bootstrap.sh:340-376 (bootstrap_install_homebrew)
  • cli/bash/commands/basectl/subcommands/setup_macos_homebrew.sh:246-306 (setup_install_homebrew)

All three implement the same SHA-256 verification and /bin/bash -c "$(curl -fsSL ...)" fallback, differing only by function-name prefix and env var names (BASE_INSTALL_DRY_RUN / BASE_BOOTSTRAP_DRY_RUN / setup's own dry-run flag).

Impact

A future security fix (e.g. tightening curl flags or verification logic) applied to one copy is easily missed in the other two, since there is no single source of truth.

Suggested fix

Extract the shared Homebrew-install decision logic into one Bash library sourced by all three entry points, similar to the existing base_first_mile_fetch_homebrew_installer helper already shared for the fetch step.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type

Projects

Status
Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions