commit 2036c7c65856f491cdfbad89dad18a3ee57ad8a8
Author: René Bertin <rjvbertin@gmail.com>
Date: Tue May 28 19:38:47 2024 +0200
patch-record-patches-in-statefile.diff
diff --git a/src/port1.0/portpatch.tcl b/src/port1.0/portpatch.tcl
index 42dbbd227..3e61a230f 100644
a
|
b
|
proc portpatch::build_getpatchtype {args} { |
68 | 68 | } |
69 | 69 | |
70 | 70 | proc portpatch::patch_main {args} { |
71 | | global UI_PREFIX |
| 71 | global UI_PREFIX target_state_fd |
72 | 72 | |
73 | 73 | # First make sure that patchfiles exists and isn't stubbed out. |
74 | 74 | if {![exists patchfiles] || [option patchfiles] eq ""} { |
… |
… |
proc portpatch::patch_main {args} { |
96 | 96 | catch {set xzcat "[findBinary xz $portutil::autoconf::xz_path] -dc"} |
97 | 97 | |
98 | 98 | foreach patch $patchlist { |
99 | | ui_info "$UI_PREFIX [format [msgcat::mc "Applying %s"] [file tail $patch]]" |
100 | | switch -- [file extension $patch] { |
101 | | .Z - |
102 | | .gz {command_exec patch "$gzcat \"$patch\" | (" ")"} |
103 | | .bz2 {command_exec patch "$bzcat \"$patch\" | (" ")"} |
104 | | .xz { |
105 | | if {[info exists xzcat]} { |
106 | | command_exec patch "$xzcat \"$patch\" | (" ")" |
107 | | } else { |
108 | | return -code error [msgcat::mc "xz binary not found; port needs to add 'depends_patch bin:xz:xz'"] |
109 | | }} |
110 | | default {command_exec patch "" "< '$patch'"} |
| 99 | set pfile [file tail $patch] |
| 100 | if {![check_statefile patch $pfile $target_state_fd]} { |
| 101 | ui_info "$UI_PREFIX [format [msgcat::mc "Applying %s"] [file tail $patch]]" |
| 102 | switch -- [file extension $patch] { |
| 103 | .Z - |
| 104 | .gz {command_exec patch "$gzcat \"$patch\" | (" ")"} |
| 105 | .bz2 {command_exec patch "$bzcat \"$patch\" | (" ")"} |
| 106 | .xz { |
| 107 | if {[info exists xzcat]} { |
| 108 | command_exec patch "$xzcat \"$patch\" | (" ")" |
| 109 | } else { |
| 110 | return -code error [msgcat::mc "xz binary not found; port needs to add 'depends_patch bin:xz:xz'"] |
| 111 | }} |
| 112 | default {command_exec patch "" "< '$patch'"} |
| 113 | } |
| 114 | write_statefile patch $pfile $target_state_fd |
| 115 | } else { |
| 116 | ui_info "$UI_PREFIX [format [msgcat::mc "Skipping already applied %s"] $pfile]" |
111 | 117 | } |
112 | 118 | } |
113 | 119 | return 0 |