search for: rm_rf

Displaying 20 results from an estimated 65 matches for "rm_rf".

2007 May 30
4
aaf and dynamic attrs: a bug?
...=> [ :first_name ] assert Contact.find(:first).respond_to?(:first_name_to_ferret) assert_equal 1, Contact.find_by_contents(''Y*'').total_hits assert_equal 1, Contact.find_by_contents(''first_name:Y*'').total_hits Contact.aaf_index.close FileUtils.rm_rf ''index'' Contact.acts_as_ferret :fields => [ :first_name, :last_name ] assert Contact.find(:first).respond_to?(:last_name_to_ferret) assert_equal 1, Contact.find_by_contents(''Y*'').total_hits assert_equal 1, Contact.find_by_contents(''first...
2012 Apr 06
2
[PATCH] virt-sysprep:add logging feature
...p_operation_cron_spool.ml index e67688b..6bd6ec4 100644 --- a/sysprep/sysprep_operation_cron_spool.ml +++ b/sysprep/sysprep_operation_cron_spool.ml @@ -17,11 +17,17 @@ *) open Sysprep_operation +open Utils module G = Guestfs -let cron_spool_perform g root = - Array.iter g#rm_rf (g#glob_expand "/var/spool/cron/*"); +let cron_spool_perform g root show_log = + let files = g#glob_expand "/var/spool/cron/*" in + Array.iter ( + fun glob -> + g#rm glob + logging show_log "Deleted %s" glob + ) files;...
2014 Sep 02
2
[PATCH] sysprep: user-account: remove the correct home
...ould start to @@ -91,7 +93,7 @@ let user_account_perform ~verbose ~quiet g root side_effects = *) g#aug_rm (sprintf "/files/etc/shadow/%s" username); g#aug_rm (sprintf "/files/etc/group/%s" username); - g#rm_rf ("/home/" ^ username) + g#rm_rf home_dir ) ) users; g#aug_save (); -- 1.9.3
2013 Dec 09
2
[PATCH] sysprep: allow to specify globbing for --delete
...;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
2014 Oct 28
1
[PATCH] sysprep: remove /var/spool/mail/username
...@ -83,6 +83,7 @@ let user_account_perform ~verbose ~quiet g root side_effects = g#aug_rm userpath; g#aug_rm (sprintf "/files/etc/shadow/%s" username); g#aug_rm (sprintf "/files/etc/group/%s" username); + g#rm_rf ("/var/spool/mail/" ^ username); match home_dir with | None -> () | Some dir -> g#rm_rf dir -- 1.9.3
2012 Feb 10
3
Installing from source missing -lruby18 in linking.
...T = Config::CONFIG["OBJEXT"] rake/rakewx.rb:$ruby_exe = Config::CONFIG["ruby_install_name"] rake/rakewx.rb: dest_dir = Config::CONFIG[''sitelibdir''] rake/rakewx.rb: cp TARGET_LIB, Config::CONFIG[''sitearchdir''] rake/rakewx.rb: rm_rf File.join(Config::CONFIG[''sitearchdir''],File.basename(TARGET_LIB)) rake/rakewx.rb: rm_rf File.join(Config::CONFIG[''sitelibdir''], ''wx.rb'') rake/rakewx.rb: rm_rf File.join(Config::CONFIG[''sitelibdir''], ''wx'...
2006 Jun 06
4
Checking if a directory is empty using File
Hi, I have one minor issue. I''m trying to check whether a directory is empty given some path to the directory. My code does the following: if(File.directory?(dirpath)) # dirpath = public/images/1 if(File.zero?(dirpath)) FileUtils.rm_rf(dirpath) end end The problem is, while testing this, if I put a file in the directory and run the above code, it still ends up deleting the entire directory which doesn''t make sense since File.zero? should not return true. I even tried using File.size?(dirpath) but that doesn''...
2012 Apr 12
1
[PATCH] sysprep: remove the bash history of users
...oston, MA 02110-1301 USA. + *) + +open Sysprep_operation + +module G = Guestfs + +let bash_history_perform g root = + let typ = g#inspect_get_type root in + if typ <> "windows" then ( + let files = g#glob_expand "/home/*/.bash_history" in + Array.iter g#rm_rf files; + g#rm_rf "/root/.bash_history"; + [] + ) + else [] + +let bash_history_op = { + name = "bash-history"; + pod_description = "\ +Remove the bash history in the guest. + +Remove the bash history of user root and any other users +who have a bash histor...
2012 Apr 24
1
[PATCH] sysprep: remove the cache of package manager
...tfs + +let package_manager_cache_perform g root = + let packager = g#inspect_get_package_management root in + match packager with + | "yum" -> + let cache = g#glob_expand "/var/cache/yum/*" in + Array.iter ( + fun dir -> + g#rm_rf dir + ) cache; [] + | "apt" -> + let cache = g#glob_expand "/var/cache/apt/archives/*" in + Array.iter ( + fun dir -> + g#rm_rf dir + ) cache; [] + | _ -> (); [] + +let package_manager_cache_op = { + name =...
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. *)
2007 Mar 09
10
Add the ability to ''eval'' ruby code in exec type?
Hi, Anyone think this is a good idea? I have found that there are some exec tasks that I am making that just shell out to ruby to do a one / two line script in the exec line, was thinking it would be nice to have an option for exec to tell it to just eval ruby code passed to it, e.g. exec { ''eval: code to evaluate'':, ... } I know Lane wants users to turn execs into
2016 Feb 03
6
[PATCH 1/3] sysprep, get-kernel: explicit the Guestfs parameter
...let globs = [ "/var/log/dump/*"; ] -let crash_data_perform g root side_effects = +let crash_data_perform (g : Guestfs.guestfs) root side_effects = let typ = g#inspect_get_type root in if typ = "linux" then ( List.iter (fun glob -> Array.iter g#rm_rf (g#glob_expand glob)) globs diff --git a/sysprep/sysprep_operation_dhcp_client_state.ml b/sysprep/sysprep_operation_dhcp_client_state.ml index 3ee91df..bf5361f 100644 --- a/sysprep/sysprep_operation_dhcp_client_state.ml +++ b/sysprep/sysprep_operation_dhcp_client_sta...
2012 Apr 03
1
[PATCH RFC] sysprep:add logging feature
...;sysprep/sysprep_operation_cron_spool.ml +++ b/sysprep/sysprep_operation_cron_spool.ml @@ -16,12 +16,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *) +open Printf open Sysprep_operation module G = Guestfs let cron_spool_perform g root = Array.iter g#rm_rf (g#glob_expand "/var/spool/cron/*"); + eprintf "Deleted /var/spool/cron/*\n"; [] let cron_spool_op = { diff --git a/sysprep/sysprep_operation_dhcp_client_state.ml b/sysprep/sysprep_operation_dhcp_client_state.ml index e3e87c...
2016 Feb 04
2
[PATCH v2 1/2] daemon: glob: add optarg to control trailing slash for dirs
Add a new optional bool "directoryslash" to indicate whether the caller wants trailing slashes in names of directories, defaulting to true (the current behaviour); this helps with interoperability with other tools (such as rm). Related to RHBZ#1293271. --- daemon/glob.c | 11 +++++++++-- generator/actions.ml | 21 ++++++++++++++++----- gobject/Makefile.inc | 2 ++
2006 Oct 24
0
[713] trunk/wxruby2: Patch for rake install, added rake uninstall
...all_ruby_lib_files.each do | lib_file | + dest = lib_file.sub(/^lib/, dest_dir) + cp lib_file, dest + chmod 0755, dest + end + end + + desc "Removes installed library files from site_ruby" + task :uninstall do | t | + rm_rf File.join(Config::CONFIG[''sitearchdir''], $dl_lib) + rm_rf File.join(Config::CONFIG[''sitelibdir''], ''wx.rb'') + rm_rf File.join(Config::CONFIG[''sitelibdir''], ''wx'') + end </ins><span...
2016 Feb 03
0
[PATCH 3/3] customize: add globbing for --delete
...ustomize_run.ml b/customize/customize_run.ml index 84f634b..6476f6a 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 ~nodirectoryslash:true 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....
2016 Feb 04
0
[PATCH v2 2/2] customize: add globbing for --delete
...ustomize_run.ml b/customize/customize_run.ml index 84f634b..82c4edd 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 ~directoryslash:false path) | `Edit (path, expr) -> message (f_"Editing: %s") path; diff --git a/generator/customize.ml b/generator/customize.ml index 19aec81..d272ffb 100644 --- a/generator/customize.m...
2006 Mar 16
1
Re: rcov 0.2.0 - code coverage tool for Ruby
...e. Amend as required or perhaps move to config/environment.rb? RCOV = "#{RBINDIR}/ruby #{RBIN} --exclude #{RCOV_EXCLUDE} --output #{RCOV_OUT}" desc "generate a coverage report for unit and functional tests together in #{RCOV_OUT}/index.html" task :rcov do rm_rf RCOV_OUT sh "#{RCOV} test/unit/*.rb test/functional/*.rb" end namespace :rcov do desc "generate a unit test coverage report in #{RCOV_OUT}/index.html" task :units do sh "#{RCOV} test/unit/*.rb" end desc "...
2012 Sep 21
1
[PATCH] sysprep: handle at jobs in cron-spool operation
...peration_cron_spool.ml b/sysprep/sysprep_operation_cron_spool.ml index 5284660..e96832c 100644 --- a/sysprep/sysprep_operation_cron_spool.ml +++ b/sysprep/sysprep_operation_cron_spool.ml @@ -23,6 +23,12 @@ module G = Guestfs let cron_spool_perform g root = Array.iter g#rm_rf (g#glob_expand "/var/spool/cron/*"); + Array.iter g#rm (g#glob_expand "/var/spool/atjobs/*"); + Array.iter g#rm (g#glob_expand "/var/spool/atjobs/.SEQ"); + Array.iter g#rm (g#glob_expand "/var/spool/at...
2007 Oct 24
0
Sweeper for few models
...del(in this case About). class AboutSweeper < ActionController::Caching::Sweeper observe About def after_create(data) expire_about(data) end def after_save(data) expire_about(data) end def after_destroy(data) expire_about(data) end def expire_about(data) FileUtils.rm_rf File.expand_path("public/about/#{data.id}", RAILS_ROOT) FileUtils.rm_rf File.expand_path("public/index.html", RAILS_ROOT) end end But I want to use one sweeper for several models. Can I write something like observer About, Book, Shop, City...... And expire thi...