Repository navigation
Read a Held Package as Installed in Both Linux Host Scripts - #3650
Conversation
install-tools.sh matched dpkg's whole status against "install ok installed", so a held package read as missing and was planned for install again, while setup-github.sh already read a hold as installed. Both scripts now carry one definition that reads the installed state alone, and a test holds the two copies equal, since each script stays independently fetchable. With a held package now counted, the Docker conflict removal would hand a held conflict to apt-get remove -y, which refuses it with exit 100. It now reads the hold first, reports a held conflict for manual action, and removes nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A held conflict now warns and stays installed while the unheld ones are still removed, the shape the issue cites from downstream, so a held package Docker does not actually conflict with no longer fails the docker install. The equality test moves beside TestPackageInstalled and reuses its function_body helper rather than a second slicer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leaving a held conflict installed while removing the others could remove docker.io and then fail the docker-ce install on the held runc or containerd, leaving the host with no engine at all. A held name on Docker's uninstall list now stops the docker install before any removal, as the issue asks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the changes include regression coverage for held-package detection, Docker conflict handling, and helper-definition parity.
No open issues 🎉
What changed in this PR
This pull request updates Linux host setup to recognize held Debian packages as installed and prevents Docker installation from removing held conflicting packages.
Changes:
- Aligns
package_installedwith dpkg’s normalized installed-status field in both Linux scripts. - Refuses Docker conflict removal when any conflicting package is held, with an
apt-mark unholdremedy. - Adds regression tests for held packages, Docker conflicts, and helper-definition parity.
| File | Summary | Review notes |
|---|---|---|
tests/test_setup_github.py |
Tests held-package detection and parity between both Linux helper definitions. | — |
tests/test_install_tools.py |
Tests held package handling and Docker conflict refusal. | Nit (P2; 1 vote): correct “a format names” to “the format names” in the new docstring. |
host-setup/README.md |
Documents the duplicated installed-package helper. | Nit (P2; 1 vote): clarify that the helper is duplicated between the Linux scripts only. |
host-setup/linux/setup-github.sh |
Uses the normalized dpkg status field to detect installed packages. | — |
host-setup/linux/install-tools.sh |
Recognizes held packages and blocks removal of held Docker conflicts. | Nit (P2; 1 vote): document held-conflict refusal and the apt-mark unhold remedy in the operator-facing Docker setup documentation. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #3650 +/- ##
===========================================
+ Coverage 81.60% 81.70% +0.09%
===========================================
Files 26 26
Lines 9070 9119 +49
===========================================
+ Hits 7402 7451 +49
Misses 1668 1668
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…Session Prompt Rules (#3667) Promotes the changes merged into `develop` since promotion #3636 to `main`. - [#3640](#3640) Pins the validator's `uvx ruff` to a Dependabot-managed manifest. - [#3642](#3642) Counts Copilot findings under the unresolved bullet and the file table. - [#3644](#3644) Aligns the split comment copies and drops the stale counts. - [#3646](#3646) Sends a command meant for the session's input line in a plain message, never in a blocking prompt. - [#3648](#3648) Opens the attended session by cloning a hub checkout of the session's own. - [#3650](#3650) Reads a held package as installed in both Linux host scripts. - [#3652](#3652) States the PowerShell `-Help` and `-h` form in the command-line argument rules. - [#3654](#3654) Counts sentences in Markdown table cells for the sentence-length check. - [#3658](#3658) Splits a table row only at an unescaped pipe in the semicolon rule. - [#3660](#3660) Finds table cell boundaries before blanking code spans and quotations. - [#3662](#3662) Names a stale job record on a completed run in `pr_review.py`. - [#3665](#3665) Keeps a line holding code after a block comment's closer out of `comment-added`. Its squash commit on `develop` carries the pull request's original title, which names a heredoc reading. That reading was withdrawn before the merge on decision #3666, so a workflow `run:` heredoc body still reads as code. - [#3669](#3669) Counts each `[Pn]` marker in a Copilot Findings cell, so a second finding in one cell is no longer dropped from triage. It answers one of the two findings Copilot raised on this promotion. The other is declined with a parser probe in its thread. Closes #3616 Closes #3610 Closes #3622 Closes #3638 Closes #3604 Closes #3511 Closes #3602 Closes #3456 Closes #3655 Closes #3657 Closes #3362 Closes #1664 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
host-setup/linux/install-tools.sh'spackage_installedmatched dpkg's whole${Status}againstinstall ok installed. A held package, whose status ishold ok installed, therefore read as missing and was planned for install again.setup-github.shalready read a hold as installed, so the two hub copies of the check disagreed.package_installed, which compares${db:Status-Status}toinstalled. Each Linux script stays independently fetchable, perhost-setup/README.md"Three Rules This Directory Follows", so the definition is an identical copy rather than a sourced file. A new test intests/test_setup_github.pyholds the two copies equal, and the README's list of duplicated helpers now names it.apt-get remove -y, which refuses it with exit 100, while a-ssimulation passes.docker_installnow reads${db:Status-Want}first. Where any name on Docker's uninstall list is held, it warns with theapt-mark unholdremedy and returns before removing anything, sodockerlands in the failed set. That covers every name on the list,docker-docincluded, on purpose. A heldruncorcontainerdbeside an unhelddocker.iowould otherwise remove the distro engine and then fail thedocker-ceinstall, leaving the host with no engine.Verification
python3 -m unittest tests.test_install_tools tests.test_setup_github: 78 tests pass, with 1 skipped. The new tests fail against the base branch'sinstall-tools.sh.debian:13container withlessandruncinstalled and held. Both scripts read the heldlessas installed.apt_missingdoes not plan either held package.docker_installreports the heldrunc, returns 1, and leaves it installed. In the same container,apt-get remove -yon the heldruncexits 100 andapt-get remove -sexits 0, which is why a dry run is not the evidence.docker_lint.pypasses shellcheck, shfmt, editorconfig-checker, markdownlint, and cspell. The pre-commit hook passes ruff, mypy, and the prose gate.function_bodyhelper. The second found that leaving a held conflict installed while still removing the others could remove the engine, fixed by restoring refuse-before-removing. The third raised nothing.Closes on promotion: #3511
🤖 Generated with Claude Code