Skip to content

Fixed simulate mode swapping package version and architecture - #6389

Open
djbclark wants to merge 1 commit into
cfengine:masterfrom
djbclark:fix/simulate-pkg-arch-version-swap
Open

djbclark wants to merge 1 commit into
cfengine:masterfrom
djbclark:fix/simulate-pkg-arch-version-swap

Conversation

@djbclark

@djbclark djbclark commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

RecordPkgOperationInChroot() wrote a package's architecture before its version, the reverse of the order both readers expect, so --simulate reported foo-1.2.3 [x86_64] instead of foo-x86_64 [1.2.3]. The fix swaps the two writes and names the record format in a comment at the writer. One regression test, which fails without the fix:

$ tests/unit/simulate_mode_test      # without the fix
test_diff_version_and_architecture: Test failed.
1 out of 3 tests failed!
$ tests/unit/simulate_mode_test      # with the fix
All 3 tests passed

Ubuntu 24.04: make -C tests/unit check → All 75 tests passed; tests/acceptance/29_simulate_mode/ as root → 4 of 4 Pass. Fork CI: djbclark#39

AI-assisted. I can't vouch for the C syntax beyond a basic level, but I did look at the logic and it seemed sound.

🤖 Generated with Claude Code

RecordPkgOperationInChroot() wrote the architecture before the version,
the reverse of the order its readers expect.

Ticket: none
Changelog: Title
Signed-off-by: Daniel JB Clark <djbclark@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cf-bottom

Copy link
Copy Markdown

Thank you for submitting a PR! Maybe @larsewi can review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants