Blame SOURCES/0028-customize-add-globbing-for-delete.patch

e76f14
From faa050d685a7c7005d683b716bcb657bdf958440 Mon Sep 17 00:00:00 2001
e76f14
From: Pino Toscano <ptoscano@redhat.com>
e76f14
Date: Thu, 4 Feb 2016 10:49:31 +0100
e76f14
Subject: [PATCH] customize: add globbing for --delete
e76f14
e76f14
Support globbing in paths passed to --delete, telling glob to not
e76f14
return directories with leading slash.
e76f14
e76f14
This re-adds back globbing for --delete in virt-sysprep, which was
e76f14
available before the integration with common code from virt-customize.
e76f14
e76f14
(cherry picked from commit 13c3698358a4de82179dba3c8855f56746525aa7)
e76f14
---
e76f14
 customize/customize_run.ml | 2 +-
e76f14
 generator/customize.ml     | 6 ++++++
e76f14
 2 files changed, 7 insertions(+), 1 deletion(-)
e76f14
e76f14
diff --git a/customize/customize_run.ml b/customize/customize_run.ml
e76f14
index 2caaa98..8c38d62 100644
e76f14
--- a/customize/customize_run.ml
e76f14
+++ b/customize/customize_run.ml
e76f14
@@ -205,7 +205,7 @@ exec >>%s 2>&1
e76f14
 
e76f14
     | `Delete path ->
e76f14
       message (f_"Deleting: %s") path;
e76f14
-      g#rm_rf path
e76f14
+      Array.iter g#rm_rf (g#glob_expand ~directoryslash:false path)
e76f14
 
e76f14
     | `Edit (path, expr) ->
e76f14
       message (f_"Editing: %s") path;
e76f14
diff --git a/generator/customize.ml b/generator/customize.ml
e76f14
index 63e4246..403bb89 100644
e76f14
--- a/generator/customize.ml
e76f14
+++ b/generator/customize.ml
e76f14
@@ -117,6 +117,12 @@ Wildcards cannot be used.";
e76f14
 Delete a file from the guest.  Or delete a directory (and all its
e76f14
 contents, recursively).
e76f14
 
e76f14
+You can use shell glob characters in the specified path.  Be careful
e76f14
+to escape glob characters from the host shell, if that is required.
e76f14
+For example:
e76f14
+
e76f14
+ virt-customize --delete '/var/log/*.log'.
e76f14
+
e76f14
 See also: I<--upload>, I<--scrub>.";
e76f14
   };
e76f14
 
e76f14
-- 
aa0300
2.7.4
e76f14