Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record applied patchfiles in the statefile #345

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RJVB
Copy link
Contributor

@RJVB RJVB commented Aug 13, 2024

Adds a "patch: " line to the statefile and verify this record before applying each subsequent patch. This is a very useful mechanism during port maintenance when some patches have to be rebased; it allows repeated application of port patch (or "higher") where only the failing patch has to be reverted and already applied patches are skipped automatically.

Also adds default fd argument to check_statefile and write_statefile in
portutil.tcl , so that they can be called externally without having to
reopen the statefile. In that case they will check/write to the current
statefile descriptor `$target_state_fd`. This will allow to call them
safely from the patch_main override procedure in the muniversal-1.1 PG.

Notes:

  1. Currently the name of the applied patch is taken from the resolved path to the patchfile and so cannot reliably include any form of hierarchical organisation used in the filespath directory. Aliasing is thus possible but has never happened to me in the several years that I have been using this mod.
    Should the record list the entries as specified in the port's patchfiles rather than in patch_main's patch_list?

  2. A similar modification will have to be made to the patch_main override in the muniversal-1.1 PG. Hence the changes proposed for check_statefile and write_statefile.

Closes: https://trac.macports.org/ticket/46927

Adds a "patch: <patchfile>" line to the statefile and verify this record
before applying each subsequent patch. This is a very useful mechanism
during port maintenance when some patches have to be rebased; it allows
repeated application of `port patch` (or "higher") where only the
failing patch has to be reverted and already applied patches are skipped
automatically.

Also adds default fd argument to check_statefile and write_statefile in
portutil.tcl , so that they can be called externally without having to
reopen the statefile. In that case they will check/write to the current
statefile descriptor `$target_state_fd`. This will allow to call them
safely from the patch_main override procedure in the muniversal-1.1 PG.
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.

1 participant