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]" |