[Libguestfs] [PATCH] sysprep: allow to specify globbing for --delete

Richard W.M. Jones rjones at redhat.com
Mon Dec 9 15:26:05 UTC 2013


On Mon, Dec 09, 2013 at 04:19:12PM +0100, Pino Toscano wrote:
> Adapt the globbing part from the old --remote-path work previously
> proposed for sysprep [1], allowing --delete to perform globbing when
> deleting paths.
> 
> [1] https://www.redhat.com/archives/libguestfs/2013-October/msg00045.html
> ---
>  sysprep/sysprep_operation_delete.ml | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/sysprep/sysprep_operation_delete.ml b/sysprep/sysprep_operation_delete.ml
> index de78a87..59d5485 100644
> --- a/sysprep/sysprep_operation_delete.ml
> +++ b/sysprep/sysprep_operation_delete.ml
> @@ -27,7 +27,9 @@ let add_paths path = paths := path :: !paths
>  
>  let path_perform g root =
>    let paths = List.rev !paths in
> -  List.iter g#rm_rf paths;
> +  if paths <> [] then (
> +    List.iter (fun glob -> Array.iter g#rm_rf (g#glob_expand glob)) paths
> +  );
>    []
>  
>  let op = {
> -- 
> 1.8.3.1

ACK, but should we update the documentation too?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




More information about the Libguestfs mailing list