Repository navigation
feat(selfupdate): update .deb installs through a registered APT repository - #21
Merged
Merged
Conversation
…itory An executable a .deb installed was always refused with ErrManaged. With Updater.APT set, one whose package comes from an APT repository that is registered on the system is updated through APT instead: - Check, Update and Install read the latest version from that repository, not from Source, so no Source credential is needed. - The repository's index and the package are fetched without root into a temporary directory, limited to the repository's sources file; APT verifies both against the repository key. - APT.Confirm is shown the exact commands (apt-get update, apt-get install of the downloaded file) before they run as root, through sudo when the process is not root. Nil Confirm installs without asking, for --yes. Anything else (no sources file, no single dpkg owner, not Linux) is still refused with ErrManaged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows temporary paths hold backslashes, which APTPlan.String quotes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
selfupdaterefused every executable a package manager owns. A.debfrom an APT repository that is registered on the system (for example one whose package adds the repository on install) can now be updated through APT, opt-in viaUpdater.APT.dpkg-query --searchnames exactly one owner (no diversion; merged-/usr aliases handled; architecture qualifier kept).Dir::State::Lists,Dir::Cache,Dir::Etc::sourcelistlimited to the sources file). The latest version is APT's candidate, and the package must be listed byapt-cache madison, so the installed version never passes for the latest. A failed fetch is an error (APT::Update::Error-Mode=any, plus a check that an index arrived).SourceandAssetare not needed on this path, so no GitLab/GitHub token..debis downloaded without root from the repository (APT checks it against the signed index). AfterAPT.Confirmapproves the plan,apt-get updateandapt-get install --yes --allow-downgrades -- <file>run as root (throughsudo --when not root), so dependencies come from all of the system's repositories. The installed version is checked afterwards.APTPlan(package, installed, target version, file, sudo, commands;String()prints them shell-quoted). False ends withErrDeclined; nil runs without asking (--yes).Testing
selfupdate/apt_test.go), race, Go 1.27.0, lint on linux/darwin/windows, cross builds.debian:trixie-slimagainst the realmittwald-toolsrepository: 0.1.12 → 0.1.13 ofmittwald-outlook-bridge-headlessas a user via sudo and as root; declined; already current;APT::Default-Releaseset system-wide; unreachable repository (error, no false "up to date").🤖 Generated with Claude Code