Skip to content

fix: correct series file entries and sort patch keys in deb target#1024

Merged
cpuguy83 merged 1 commit into
project-dalec:mainfrom
burak-ok:burak/patches/deb
Apr 8, 2026
Merged

fix: correct series file entries and sort patch keys in deb target#1024
cpuguy83 merged 1 commit into
project-dalec:mainfrom
burak-ok:burak/patches/deb

Conversation

@burak-ok
Copy link
Copy Markdown
Contributor

@burak-ok burak-ok commented Apr 8, 2026

Fix two bugs in the deb patch handling:

  1. sourcePatchesDir wrote the target source name instead of the patch source name to the series file, causing incorrect documentation.
  2. createPatchScript iterated over the Patches map without sorting, causing non-deterministic patch application order unlike the RPM target which sorts keys.

Add unit tests for both issues.

Fix two bugs in the deb patch handling:
1. sourcePatchesDir wrote the target source name instead of the patch
   source name to the series file, causing incorrect documentation.
2. createPatchScript iterated over the Patches map without sorting,
   causing non-deterministic patch application order unlike the RPM
   target which sorts keys.

Add unit tests for both issues.

Signed-off-by: Burak Ok <burakok@microsoft.com>
Copilot AI review requested due to automatic review settings April 8, 2026 15:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes two debian patch-handling bugs in Dalec’s DEB packaging implementation to make patch documentation and patch application order deterministic (aligning behavior with the RPM target).

Changes:

  • Write the correct patch source names to the series file generated under debian/dalec/patches/....
  • Sort spec.Patches map keys before generating the DEB patch application script to ensure deterministic order.
  • Add unit tests covering both the series file contents and the sorted patch script output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packaging/linux/deb/debroot.go Fixes series file entries and ensures deterministic patch script generation by sorting patch keys.
packaging/linux/deb/debroot_patch_test.go Adds regression tests for correct series contents and deterministic patch ordering in the generated script.

Copy link
Copy Markdown
Collaborator

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@cpuguy83 cpuguy83 merged commit fc365c4 into project-dalec:main Apr 8, 2026
63 of 67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants