Skip to content

Commit f1d345b

Browse files
committed
update Libraries versions
* ocaml version minimum is 4.07 * git-ocaml is now 2.0 * patience-diff is 0.11. (version 0.12 is not compatible with windows)
1 parent 3a47ab9 commit f1d345b

File tree

5 files changed

+28
-21
lines changed

5 files changed

+28
-21
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ environment:
66
FORK_BRANCH: master
77
CYG_ROOT: C:\cygwin64
88
PACKAGE: plotkicadsch
9-
OPAM_SWITCH: 4.06.0+mingw64c
9+
OPAM_SWITCH: 4.07.0+mingw64c
1010
PINS: kicadsch:. plotkicadsch:.
1111

1212
install:

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ services:
55
install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-docker.sh
66
script: bash -ex ./.travis-docker.sh
77
env:
8-
- OCAML_VERSION=4.06 DISTRO="ubuntu-16.04" PACKAGE=kicadsch
9-
- PINS="kicadsch:." OCAML_VERSION=4.06 DISTRO="ubuntu-16.04" PACKAGE=plotkicadsch
8+
- OCAML_VERSION=4.07 DISTRO="ubuntu-16.04" PACKAGE=kicadsch
9+
- PINS="kicadsch:." OCAML_VERSION=4.07 DISTRO="ubuntu-16.04" PACKAGE=plotkicadsch

plotkicadsch.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ depends: [
2424
"lwt"
2525
"lwt_ppx" {build}
2626
"sha"
27-
"git" {< "2.0.0"}
27+
"git" {>= "2.0.0"}
2828
"git-unix"
2929
"base64" {>= "3.0.0"}
30-
"patience_diff" { >= "v0.10.0" }
30+
"patience_diff" { < "v0.12.0" }
3131
"core_kernel"
3232
"cmdliner"
3333
]

plotkicadsch/src/plotgitsch.ml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ exception InternalGitError of string
2222
let git_fs commitish =
2323
( module struct
2424
open Git_unix
25-
module Search = Git.Search.Make (FS)
25+
module Search = Git.Search.Make (Store)
2626

2727
let rev_parse r =
2828
SysAbst.pread "git" [|"rev-parse"; r ^ "^{commit}"|]
2929
>>= fun s ->
30-
try Lwt.return @@ Git_unix.Hash_IO.of_hex @@ String.prefix s 40
30+
try Lwt.return @@ Store.Hash.of_hex @@ String.prefix s 40
3131
with _ -> Lwt.fail (InternalGitError ("cannot parse rev " ^ r))
3232

3333
let doc = "Git rev " ^ commitish
@@ -56,7 +56,13 @@ let git_fs commitish =
5656
in
5757
recurse @@ (Sys.getcwd (), [])
5858

59-
let fs = git_root >>= fun (root, _) -> FS.create ~root ()
59+
let fs =
60+
let%lwt root, _ = git_root in
61+
match%lwt Store.v (Fpath.v root) with
62+
| Ok s ->
63+
Lwt.return s
64+
| Error e ->
65+
Lwt.fail (InternalGitError (Fmt.strf "%a" Store.pp_error e))
6066

6167
let theref = rev_parse commitish
6268

@@ -72,30 +78,31 @@ let git_fs commitish =
7278
(InternalGitError
7379
("path not found: /" ^ String.concat ~sep:Filename.dir_sep path))
7480
| Some sha -> (
75-
match%lwt FS.read t sha with
76-
| Some a ->
81+
match%lwt Store.read t sha with
82+
| Ok a ->
7783
action a
78-
| None ->
79-
Lwt.fail (InternalGitError "sha not found") )
84+
| Error e ->
85+
Lwt.fail (InternalGitError (Fmt.strf "%a" Store.pp_error e)) )
8086

8187
let get_content filename =
8288
with_path filename
8389
@@ function
84-
| Git.Value.Blob b ->
85-
Lwt.return (Git.Blob.to_raw b)
90+
| Store.Value.Blob b ->
91+
Lwt.return (Store.Value.Blob.to_string b)
8692
| _ ->
8793
Lwt.fail (InternalGitError "not a valid path")
8894

8995
let find_file filter t =
90-
let open Git.Tree in
91-
t
92-
|> List.filter ~f:(fun e -> filter e.name)
93-
|> List.map ~f:(fun e -> (e.name, Git.Hash.to_hex e.node))
96+
let open Store.Value.Tree in
97+
to_list t
98+
|> List.filter_map ~f:(fun {name; node; _} ->
99+
if filter name then Some (name, Store.Hash.to_hex node) else None
100+
)
94101

95102
let list_files pattern =
96103
with_path []
97104
@@ function
98-
| Git.Value.Tree t ->
105+
| Store.Value.Tree t ->
99106
Lwt.return @@ find_file pattern t
100107
| _ ->
101108
Lwt.fail (InternalGitError "not a tree!")

plotkicadsch/src/sysAbst.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ let build_tmp_svg_name ~keep aprefix aschname =
6868
in
6969
match detect_os () with
7070
| MacOS | Linux ->
71-
Filename.temp_file root_prefix ".svg"
71+
Stdlib.Filename.temp_file root_prefix ".svg"
7272
| Cygwin | Windows ->
7373
if keep then root_prefix ^ ".svg"
74-
else Filename.temp_file root_prefix ".svg"
74+
else Stdlib.Filename.temp_file root_prefix ".svg"
7575

7676
let finalize_tmp_file fnl ~keep_as =
7777
match detect_os () with

0 commit comments

Comments
 (0)