mllib: Add quote function to Common_utils module.

Remove multiple places where we let quote = Filename.quote
This commit is contained in:
Richard W.M. Jones
2016-12-08 12:49:38 +00:00
parent 2cc348448a
commit 07fb30b161
10 changed files with 4 additions and 17 deletions

View File

@@ -30,8 +30,6 @@ and revision =
| Rev_int of int
| Rev_string of string
let quote = Filename.quote
let string_of_revision = function
| Rev_int n -> string_of_int n
| Rev_string s -> s

View File

@@ -21,5 +21,3 @@
open Printf
open Common_utils
let quote = Filename.quote

View File

@@ -21,8 +21,6 @@ open Common_utils
open Printf
let quote = Filename.quote
let unit_GB howmany =
(Int64.of_int howmany) *^ 1024_L *^ 1024_L *^ 1024_L

View File

@@ -234,6 +234,7 @@ module String = struct
end
let (//) = Filename.concat
let quote = Filename.quote
let ( +^ ) = Int64.add
let ( -^ ) = Int64.sub

View File

@@ -113,6 +113,9 @@ end
val ( // ) : string -> string -> string
(** Concatenate directory and filename. *)
val quote : string -> string
(** Shell-safe quoting of a string (alias for {!Filename.quote}). *)
val ( +^ ) : int64 -> int64 -> int64
val ( -^ ) : int64 -> int64 -> int64
val ( *^ ) : int64 -> int64 -> int64

View File

@@ -20,8 +20,6 @@ open Printf
open Common_utils
let quote = Filename.quote
type t = {
curl : string;
args : args;

View File

@@ -24,8 +24,6 @@ open Common_utils
module G = Guestfs
let quote = Filename.quote
(* Return true if the filesystem is a read-only LV (RHBZ#1185561). *)
let is_read_only_lv (g : G.guestfs) =
let lvs = Array.to_list (g#lvs_full ()) in

View File

@@ -64,8 +64,6 @@ let default_plan = {
let failwithf fs = ksprintf failwith fs
let quote = Filename.quote
let run ~test ?input_disk ?input_xml ?(test_plan = default_plan) () =
let input_disk =
match input_disk with

View File

@@ -23,8 +23,6 @@ open Printf
open Common_gettext.Gettext
open Common_utils
let quote = Filename.quote
external drive_name : int -> string = "v2v_utils_drive_name"
external drive_index : string -> int = "v2v_utils_drive_index"

View File

@@ -18,9 +18,6 @@
(** Utilities used in virt-v2v only. *)
val quote : string -> string
(** The {!Filename.quote} function. *)
val drive_name : int -> string
val drive_index : string -> int