Skip to content

Commit

Permalink
Replace the dependency on GNU patch by a strict dependency on git
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Dec 22, 2022
1 parent c5c32a0 commit e69d1b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src/client/opamInitDefaults.ml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ let not_open_free_bsd_filter =
let win32_filter = os_filter "win32"
let sandbox_filter = FOr (linux_filter, macos_filter)

let gpatch_filter = FOr (openbsd_filter, freebsd_filter)
let patch_filter = FNot gpatch_filter

let gtar_filter = openbsd_filter
let tar_filter = FNot gtar_filter

Expand Down Expand Up @@ -132,8 +129,7 @@ let required_tools ~sandboxing () =
req_dl_tools () @
[
["diff"], None, None;
["patch"], None, Some patch_filter;
["gpatch"], None, Some gpatch_filter;
["git"], None, None;
["tar"], None, Some tar_filter;
["gtar"], None, Some gtar_filter;
["unzip"], None, None;
Expand Down
8 changes: 1 addition & 7 deletions src/core/opamSystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1590,13 +1590,7 @@ let patch ?(preprocess=true) ~dir p =
else
p
in
let patch_cmd =
match OpamStd.Sys.os () with
| OpamStd.Sys.OpenBSD
| OpamStd.Sys.FreeBSD -> "gpatch"
| _ -> "patch"
in
make_command ~name:"patch" ~dir patch_cmd ["-p1"; "-i"; p'] @@> fun r ->
make_command ~name:"git apply" ~dir "git" ["apply"; "-p1"; p'] @@> fun r ->
if not (OpamConsole.debug ()) then Sys.remove p';
if OpamProcess.is_success r then Done None
else Done (Some (Process_error r))
Expand Down

0 comments on commit e69d1b5

Please sign in to comment.