Support globbing in paths passed to --delete, now that glob will return
paths usable for rm.
This re-adds back globbing for --delete in virt-sysprep, which was
available before the integration with common code from virt-customize.
---
customize/customize_run.ml | 2 +-
generator/customize.ml | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/customize/customize_run.ml b/customize/customize_run.ml
index 84f634b..5c1587c 100644
--- a/customize/customize_run.ml
+++ b/customize/customize_run.ml
@@ -191,7 +191,7 @@ exec >>%s 2>&1
| `Delete path ->
message (f_"Deleting: %s") path;
- g#rm_rf path
+ Array.iter g#rm_rf (g#glob_expand path)
| `Edit (path, expr) ->
message (f_"Editing: %s") path;
diff --git a/generator/customize.ml b/generator/customize.ml
index 19aec81..5d9a19b 100644
--- a/generator/customize.ml
+++ b/generator/customize.ml
@@ -115,6 +115,11 @@ Wildcards cannot be used.";
Delete a file from the guest. Or delete a directory (and all its
contents, recursively).
+You can use shell glob characters in the specified path; note that such
+metacharacters might require proper escape. For example:
+
+ virt-customize --delete '/var/log/*.log'.
+
See also: I<--upload>, I<--scrub>.";
};
--
2.5.0