Skip to content

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.
@RJVB RJVB force-pushed the staterecord-patches branch from 48fc655 to 4c86f08 Compare August 14, 2024 12:10
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