File tree 3 files changed +10
-4
lines changed
3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 90
90
## Shell
91
91
92
92
## Internal
93
+ * Fix error in ` OpamSystem.transform_patch ` - patches were only applied when debugging [ #6182 @dra27 regression since #3449 ]
93
94
94
95
## Internal: Windows
95
96
Original file line number Diff line number Diff line change @@ -1485,10 +1485,12 @@ let translate_patch ~dir orig corrected =
1485
1485
process_state_transition `Header state transforms |> List. rev
1486
1486
in
1487
1487
let transforms = fold_lines `Header 1 [] in
1488
- if transforms = [] then
1488
+ if transforms = [] then begin
1489
+ log ~level: 1 " No patch translation needed for %s -> %s" orig corrected;
1489
1490
copy_file orig corrected
1490
- else begin
1491
+ end else begin
1491
1492
seek_in ch 0 ;
1493
+ log ~level: 1 " Transforming patch %s to %s" orig corrected;
1492
1494
let ch_out =
1493
1495
try open_out_bin corrected
1494
1496
with Sys_error _ ->
@@ -1503,12 +1505,13 @@ let translate_patch ~dir orig corrected =
1503
1505
else
1504
1506
(id, (fun s -> s ^ " \r " ), strip 1 )
1505
1507
in
1506
- if OpamConsole. debug () then
1508
+ if OpamConsole. debug () then begin
1507
1509
let log_transform (first_line , last_line , add_cr ) =
1508
1510
let indicator = if add_cr then '+' else '-' in
1509
1511
log ~level: 3 " Transform %d-%d %c\\ r" first_line last_line indicator
1510
1512
in
1511
- List. iter log_transform transforms;
1513
+ List. iter log_transform transforms
1514
+ end ;
1512
1515
let rec fold_lines n transforms =
1513
1516
match input_line ch with
1514
1517
| line ->
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ PATCH No CRLF adaptation necessary for b/test1
7
7
PATCH No CRLF adaptation necessary for b/test2
8
8
PATCH No CRLF adaptation necessary for b/test3
9
9
PATCH No CRLF adaptation necessary for b/will-null-file
10
+ PATCH No patch translation needed for input.patch -> output.patch
10
11
Before patch state of c:
11
12
./always-crlf: CRLF
12
13
./always-lf: LF
@@ -44,6 +45,7 @@ PATCH No CRLF adaptation necessary for b/test1
44
45
PATCH Adding \r to patch chunks for b/test2
45
46
PATCH No CRLF adaptation necessary for b/test3
46
47
PATCH Adding \r to patch chunks for b/will-null-file
48
+ PATCH Transforming patch input.patch to output.patch
47
49
PATCH Transform 32-36 +\r
48
50
PATCH Transform 62-67 +\r
49
51
PATCH Transform 82-87 +\r
You can’t perform that action at this time.
0 commit comments