Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Mar 6, 2025
1 parent 6da29f1 commit 2613e96
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
1 change: 0 additions & 1 deletion src/core/opamSystem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,6 @@ let internal_patch ~allow_unclean ~patch_filename ~dir diffs =
write file content;
| Patch.Delete file ->
let file = get_path file in
(* TODO: apply the patch and check the file is empty *)
Unix.unlink file
| Patch.Create file ->
let file = get_path file in
Expand Down
24 changes: 9 additions & 15 deletions src/repository/opamRepositoryBackend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,16 @@ let get_diff parent_dir dir1 dir2 =
| None, Some {Unix.st_kind = Unix.S_DIR; _}
| Some {Unix.st_kind = Unix.S_DIR; _}, Some {Unix.st_kind = Unix.S_DIR; _} ->
aux diffs file1 file2
| Some {Unix.st_kind = Unix.S_LNK; _}, None
| None, Some {Unix.st_kind = Unix.S_LNK; _}
| Some {Unix.st_kind = Unix.S_LNK; _}, Some {Unix.st_kind = Unix.S_LNK; _} ->
assert false (* TODO *)
| Some {Unix.st_kind = Unix.S_REG; _}, Some {Unix.st_kind = Unix.S_DIR; _} ->
assert false (* TODO *)
| Some {Unix.st_kind = Unix.S_DIR; _}, Some {Unix.st_kind = Unix.S_REG; _} ->
assert false (* TODO *)
| Some {Unix.st_kind = Unix.S_REG; _}, Some {Unix.st_kind = Unix.S_LNK; _} ->
assert false (* TODO *)
| Some {Unix.st_kind = Unix.S_LNK; _}, Some {Unix.st_kind = Unix.S_REG; _} ->
assert false (* TODO *)
| Some {Unix.st_kind = Unix.S_LNK; _}, Some {Unix.st_kind = Unix.S_DIR; _} ->
assert false (* TODO *)
| Some {Unix.st_kind = Unix.S_DIR; _}, Some {Unix.st_kind = Unix.S_LNK; _} ->
assert false (* TODO *)
let content2 = Option.map (readfile parent_dir) file2 in
let diffs = add_to_diffs None content2 diffs in
aux diffs file1 None
| Some {Unix.st_kind = Unix.S_REG; _}, Some {Unix.st_kind = Unix.S_DIR; _} ->
let diffs = aux diffs None file2 in
let content1 = Option.map (readfile parent_dir) file1 in
add_to_diffs content1 None diffs
| Some {Unix.st_kind = Unix.S_LNK; _}, _ | _, Some {Unix.st_kind = Unix.S_LNK; _} ->
failwith "Symlinks are unsupported"
| Some {Unix.st_kind = Unix.S_CHR; _}, _ | _, Some {Unix.st_kind = Unix.S_CHR; _} ->
failwith "Character devices are unsupported"
| Some {Unix.st_kind = Unix.S_BLK; _}, _ | _, Some {Unix.st_kind = Unix.S_BLK; _} ->
Expand Down
4 changes: 2 additions & 2 deletions src_ext/Makefile.sources
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ MD5_swhid_core = 77d88d4b1d96261c866f140c64d89af8
URL_menhir = https://gitlab.inria.fr/fpottier/menhir/-/archive/20240715/archive.tar.gz
MD5_menhir = d39a8943fe1be28199e5ec1f4133504c

URL_patch = https://github.com/kit-ty-kate/patch/archive/cfc167d68084d9e742e74c9bb22c18ea1221e483.tar.gz
MD5_patch = 9d1ead73e678fa2f51a70a933b0bf017
URL_patch = https://github.com/hannesm/patch/releases/download/v3.0.0-alpha1/patch-3.0.0-alpha1.tar.gz
MD5_patch = 03aa87f8500c9caf4a73b2299c19b514

0 comments on commit 2613e96

Please sign in to comment.