search for: rm_rf_only_fil

Displaying 13 results from an estimated 13 matches for "rm_rf_only_fil".

Did you mean: rm_rf_only_files
2015 Jul 01
5
[PATCH 1/3] mllib: add an optional filter for rm_rf_only_files
This way it is possible to use rm_rf_only_files, but not removing specific files. --- mllib/common_utils.ml | 8 +++++++- mllib/common_utils.mli | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 516cff3..3737b4c 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_...
2015 Mar 05
1
Re: [PATCH] customize: add --truncate-recursive option
On Thu, Mar 05, 2015 at 01:58:21PM +0100, Maros Zatko wrote: > + let files = List.filter (fun f -> g#is_file (path ^ f)) maybefiles in I'm surprised that path ^ f works ... Suggest using the library function `rm_rf_only_files' instead. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines...
2015 Jul 01
0
[PATCH 3/3] sysprep: rework and fix cron-spool operation (RHBZ#1229305)
...if g#is_file f then + (* This should overwrite the file in-place, as it's a very + * small buffer which will be handled using internal_write. + * This way, existing attributes like SELinux labels are + * preserved. + *) + g#write f "00000\n" in + + rm_rf_only_files g ~filter:is_seq "/var/spool/cron/"; + reset "/var/spool/cron/atjobs/.SEQ"; Array.iter g#rm (g#glob_expand "/var/spool/atjobs/*"); - Array.iter g#rm (g#glob_expand "/var/spool/atjobs/.SEQ"); + reset "/var/spool/atjobs/.SEQ"; Array.iter g#...
2015 Jul 01
0
[PATCH 2/2] sysprep: rework and fix cron-spool operation (RHBZ#1229305)
...if g#is_file f then + (* This should overwrite the file in-place, as it's a very + * small buffer which will be handled using internal_write. + * This way, existing attributes like SELinux labels are + * preserved. + *) + g#write f "00000\n" in + + rm_rf_only_files g ~filter:is_seq "/var/spool/cron/"; + reset "/var/spool/cron/atjobs/.SEQ"; Array.iter g#rm (g#glob_expand "/var/spool/atjobs/*"); - Array.iter g#rm (g#glob_expand "/var/spool/atjobs/.SEQ"); + reset "/var/spool/atjobs/.SEQ"; Array.iter g#...
2015 Mar 05
0
[PATCH v2] customize: add --truncate-recursive option
...+ }; + { op_name = "timezone"; op_type = String "TIMEZONE"; op_discrim = "`Timezone"; diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index 76d8b79..0219b7e 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -619,6 +619,14 @@ let rm_rf_only_files (g : Guestfs.guestfs) dir = List.iter g#rm files ) +let truncate_recursive (g : Guestfs.guestfs) dir = + if g#is_dir dir then ( + let files = Array.map (Filename.concat dir) (g#find dir) in + let files = Array.to_list files in + let files = List.filter g#is_file files in +...
2015 Mar 05
2
[PATCH v2] customize: add --truncate-recursive option
Allows user to recursively truncate all files in a directory. Related to RHBZ#119673 Maros Zatko (1): customize: add --truncate-recursive option builder/cmdline.ml | 3 ++- customize/customize_run.ml | 4 ++++ generator/customize.ml | 8 ++++++++ mllib/common_utils.ml | 8 ++++++++ mllib/common_utils.mli | 2 ++ 5 files changed, 24 insertions(+), 1 deletion(-) -- 1.9.3
2015 Jul 01
4
[PATCH 1/2] mllib: add and use last_part_of
Collect this small snippet to get the part of a string after the last occurrency of a character; replace with it the current snippets doing the same. Should be just code motion. --- customize/password.ml | 5 +++-- mllib/common_utils.ml | 7 +++++++ mllib/common_utils.mli | 3 +++ sysprep/sysprep_operation_user_account.ml | 5 +++--
2016 Jun 13
1
[PATCH] customize: Give an error if --truncate-recursive path does not exist (RHBZ#1345809).
...or directory Thanks: Xianghua Chen --- mllib/common_utils.ml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml index dfffae3..9765a79 100644 --- a/mllib/common_utils.ml +++ b/mllib/common_utils.ml @@ -779,12 +779,10 @@ let rm_rf_only_files (g : Guestfs.guestfs) ?filter dir = ) let truncate_recursive (g : Guestfs.guestfs) dir = - if g#is_dir dir then ( - let files = Array.map (Filename.concat dir) (g#find dir) in - let files = Array.to_list files in - let files = List.filter g#is_file files in - List.iter g#trunca...
2015 Mar 05
2
[PATCH] customize: add --truncate-recursive option
Allows user to recursively truncate all files in a directory. Related to RHBZ#119673 Maros Zatko (1): customize: add --truncate-recursive option builder/cmdline.ml | 3 ++- customize/customize_run.ml | 6 ++++++ generator/customize.ml | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) -- 1.9.3
2016 Apr 21
2
[PATCH 1/2] sparsify: Refactor handling of checks of copying mode / --in-place.
Just refactoring, no change. --- sparsify/cmdline.ml | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/sparsify/cmdline.ml b/sparsify/cmdline.ml index ce2b913..bd49e71 100644 --- a/sparsify/cmdline.ml +++ b/sparsify/cmdline.ml @@ -98,6 +98,7 @@ read the man page virt-sparsify(1). let check_tmpdir = !check_tmpdir in let
2014 Oct 18
5
GIT: [PATCH 0/5] v2v: Multiple fixes for handling semi-standard OVA files (RHBZ#1152998).
OVA not a real standard. Colour me surprised ...
2014 Jan 21
1
[PATCH 1/2] sysprep: Update comments.
--- sysprep/sysprep_operation.mli | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sysprep/sysprep_operation.mli b/sysprep/sysprep_operation.mli index 61dde72..eb89db4 100644 --- a/sysprep/sysprep_operation.mli +++ b/sysprep/sysprep_operation.mli @@ -16,14 +16,16 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) -(** Structure used to describe sysprep
2017 Feb 14
14
[PATCH 00/10] dib/API: improvements and fixes
Hi, this patch series does changes mostly in virt-dib, few bug fixes and a couple of new features (mostly implemented upstream already). In addition, one new API is added, and a new optional argument for an existing API is added (the latter is not needed, but could be useful anyway). Thanks, Pino Toscano (10): dib: fix listing envvars in fake-sudo dib: source dib "die" script in