[Libguestfs] [PATCH] dib: Rewrite match statement as ordinary if statement.
Pino Toscano
ptoscano at redhat.com
Thu Apr 21 16:35:14 UTC 2016
On Thursday 21 April 2016 12:05:56 Richard W.M. Jones wrote:
> Just stylistic change, no functional change.
> ---
In principle it is fine, although I left it that way in case the UUID
is set also for other filesystems (upstream still supports ext only
for this). No problems either way.
> dib/dib.ml | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/dib/dib.ml b/dib/dib.ml
> index 06a1f67..35ae6b7 100644
> --- a/dib/dib.ml
> +++ b/dib/dib.ml
> @@ -781,9 +781,8 @@ let main () =
> ) @ mkfs_options @ [ "-t"; cmdline.fs_type; blockdev ] in
> ignore (g#debug "sh" (Array.of_list ([ "mkfs" ] @ mkfs_options)));
> g#set_label blockdev root_label;
> - (match cmdline.fs_type with
> - | x when String.is_prefix x "ext" -> g#set_uuid blockdev rootfs_uuid
> - | _ -> ());
> + if String.is_prefix cmdline.fs_type "ext" then
> + g#set_uuid blockdev rootfs_uuid;
> g#mount blockdev "/";
> g#mkmountpoint "/tmp";
> mount_aux ();
>
--
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160421/79527f93/attachment.sig>
More information about the Libguestfs
mailing list