Repository navigation
feat: parse the full apt install-progress status-fd stream - #21
Merged
Merged
Conversation
eatradish
force-pushed
the
dpkg-progress-parser
branch
3 times, most recently
from
August 25, 2026 05:19
d7d11ab to
338ede5
Compare
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The fd wired to InstallProgressOpt::Fd is apt's PackageManagerProgressFd (oma-apt do_install_fd), so the stream is apt's install-progress format (TYPE:ARG1:ARG2:MSG), not raw dpkg output. Replace the ad-hoc parser with one that understands every line type: - pmstatus: real progress; apt's percent is already the overall, monotonic percentage, so take it verbatim with a clamp. "dpkg-exec" is apt's pseudo-package marking each dpkg re-run and must not count as a package. - pmerror / pmconffile: relayed with the bar held so failures and conffile prompts surface without moving progress. - dlstatus: download progress; relayed without moving the dpkg bar so a download phase cannot push it to 100 prematurely. - media-change and anything unknown: relayed raw with the bar held (media-change is emitted with a literal "media-change: " prefix). Percent never decreases (overall = overall.max(...)), fixing the mid-run rollback caused by dpkg re-runs re-emitting 0.0 progress. The comment block now cites the exact reference implementations with file:line for every line type (apt-pkg/install-progress.cc, apt-pkg/acquire.cc, apt-pkg/acquire-worker.cc, apt-pkg/deb/dpkgpm.cc, dpkg src/main/*.c and lib/dpkg/*.c, oma-apt apt-pkg-c/pkgmanager.h). `DpkgProgress` borrows its fields (`&str`) instead of allocating strings, since each event is serialised before the source line drops.
MingcongBai
force-pushed
the
dpkg-progress-parser
branch
from
September 1, 2026 09:00
d1325eb to
34d8e9f
Compare
MingcongBai
approved these changes
Sep 4, 2026
MingcongBai
left a comment
Member
There was a problem hiding this comment.
Tested good against plasma-aosc-update.
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.
Description
Parse apt's install-progress status-fd stream correctly. The old parser split every line on
:and assumed exactly four fields, so messages whose text contained a colon were truncated, unrecognised line types (media-change, raw dpkg lines) fell into a mislabelled fallback, and the progress percent could move backwards when dpkg re-ran.src/oma.rs: rewrite the parser around apt's install-progress format — classify every line kind (pmstatus/pmerror/pmconffile/dlstatus/dpkg_raw) with asplitn(4, ':')so the message tail may itself contain:downloadstage so it cannot push the dpkg bar to 100 prematurelymedia-change) verbatim; document the format against the apt source (v3.3.3)The focus is one thing: an accurate, never-backwards progress bar with every install line type surfaced correctly to the UI.
About AI
This PR was written in collaboration with Deepseek V4 Flash in a VS Code agent session. I have reviewed and amended the code, tested it thoroughly, and updated the comments.
Assisted-by: Deepseek noreply@deepseek.com