lib/rbbt/workflow/util/archive.rb in rbbt-util-5.30.9 vs lib/rbbt/workflow/util/archive.rb in rbbt-util-5.30.10
- old
+ new
@@ -49,11 +49,11 @@
end
Log.debug "Archive finished at: #{target}"
end
end
- def self.job_files_for_archive(files, recursive = false)
+ def self.job_files_for_archive(files, recursive = false, skip_overriden = false)
job_files = Set.new
jobs = files.collect do |file|
if Step === file
file
@@ -63,10 +63,12 @@
end
end.uniq
jobs.each do |step|
next unless File.exists?(step.path)
+ next if skip_overriden && step.overriden
+
job_files << step.path
job_files << step.info_file if File.exists?(step.info_file)
job_files << Step.md5_file(step.path) if File.exists?(Step.md5_file step.path)
job_file_dir_content = Dir.glob(step.files_dir + '/**/*')
job_files += job_file_dir_content
@@ -256,12 +258,12 @@
end
end
end
end
- def self.purge(path, recursive = false)
+ def self.purge(path, recursive = false, skip_overriden = true)
path = [path] if String === path
- job_files = job_files_for_archive path, recursive
+ job_files = job_files_for_archive path, recursive, skip_overriden
job_files.each do |file|
begin
Log.debug "Purging #{file}"
Open.rm_rf file if Open.exists?(file)