From f9d7acbb09400aaa300055569c1595e246051e3a Mon Sep 17 00:00:00 2001 From: Thomas Gazagnaire Date: Fri, 15 Jul 2016 13:23:34 +0100 Subject: [PATCH 1/3] Update change log. --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 6b3927a..9b7ebed 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +## v0.7.2 (2016-07-15) + +* fix more dependency issues in the META file + ## v0.7.1 (2016-07-15) * switch to topkg From 42bb14bbbc2da8098dd0027d27e415b8af50d2b1 Mon Sep 17 00:00:00 2001 From: David Scott Date: Mon, 18 Jul 2016 14:13:38 +0100 Subject: [PATCH 2/3] Remove the rest of stringext This completes the job started in 1f4321a96ba28b9447c65fca939fdc4f7c0ffbae Signed-off-by: David Scott --- src/_tags | 2 +- src/main.ml | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/_tags b/src/_tags index b667868..dd62adc 100644 --- a/src/_tags +++ b/src/_tags @@ -1,4 +1,4 @@ -<*.*>: package(stringext), package(result), package(fmt), package(lambda-term) +<*.*>: package(astring), package(result), package(fmt), package(lambda-term) <*.*>: package(cstruct), package(cstruct.lwt) <*.*>: package(lwt) <*.*>: package(cmdliner, logs.fmt) diff --git a/src/main.ml b/src/main.ml index a830fbb..9f9ac00 100644 --- a/src/main.ml +++ b/src/main.ml @@ -18,6 +18,7 @@ open Protocol_9p open Infix open Lwt +open Astring let project_url = "http://github.com/mirage/ocaml-9p" let version = "%%VERSION%%" @@ -39,11 +40,11 @@ let finally f g = Lwt.fail e) let parse_address address = - match Stringext.split ~on:':' ~max:2 address with - | [ proto; address ] -> proto, address - | _ -> address, "5640" + match String.cut ~sep:":" address with + | Some (proto, address) -> proto, address + | None -> address, "5640" -let parse_path x = Stringext.split x ~on:'/' +let parse_path x = String.cuts x ~sep:"/" let with_client address username f = let proto, address = parse_address address in @@ -160,7 +161,7 @@ let print_stats stats = let rows = Array.of_list (List.map row_of_stat stats) in let padto n x = let extra = max 0 (n - (String.length x)) in - x ^ (String.make extra ' ') in + x ^ (String.v extra (fun _ -> ' ')) in Array.iter (fun row -> Array.iteri (fun i txt -> let column = Array.map (fun row -> row.(i)) rows in @@ -200,7 +201,7 @@ class read_line ~term ~history ~state = object(self) initializer let open React in let open LTerm_text in - self#set_prompt (S.const (eval [ S (Printf.sprintf "9P %s> " (String.concat "/" !cwd)) ])) + self#set_prompt (S.const (eval [ S (Printf.sprintf "9P %s> " (String.concat ~sep:"/" !cwd)) ])) end let shell debug address username = @@ -209,7 +210,7 @@ let shell debug address username = with_client address username (fun t -> let execute_command x = - match Stringext.split ~on:' ' x with + match String.cuts ~sep:" " x with | [ "ls" ] -> begin Client.readdir t !cwd >>= function @@ -221,7 +222,7 @@ let shell debug address username = return () end | [ "cd"; dir ] -> - let dir' = Stringext.split ~on:'/' dir in + let dir' = String.cuts ~sep:"/" dir in let newdir = if dir <> "" && dir.[0] = '/' then dir' else if dir = "." then !cwd @@ -273,7 +274,7 @@ let shell debug address username = >>= fun () -> return () | "write" :: file :: rest -> - let data = String.concat " " rest in + let data = String.concat ~sep:" " rest in let buf = Cstruct.create (String.length data) in Cstruct.blit_from_string data 0 buf 0 (Cstruct.len buf); begin From cccc22750360aefa57c704313a49d4c8703cc52d Mon Sep 17 00:00:00 2001 From: David Scott Date: Mon, 18 Jul 2016 14:15:55 +0100 Subject: [PATCH 3/3] Update CHANGES.md for v0.7.3 Signed-off-by: David Scott --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 9b7ebed..8e25a11 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +## v0.7.3 (2016-07-18) + +* remove the remaining uses of stringext (in the CLI example) + ## v0.7.2 (2016-07-15) * fix more dependency issues in the META file