Skip to content

Commit

Permalink
Write .orig and .rej files upon failure to patch file
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Jan 19, 2025
1 parent 6a05509 commit 10a485e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/opamSystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,8 @@ let internal_patch ~patch_filename ~dir diffs =
x
| None -> assert false
| exception _ ->
OpamStd.Option.iter (write (file^".orig")) content;
write (file^".rej") (Format.asprintf "%a" Patch.pp diff);
raise (Internal_patch_error (fmt "Patch %S does not apply cleanly." patch_filename))
in
let apply diff = match diff.Patch.operation with
Expand Down

0 comments on commit 10a485e

Please sign in to comment.