def prepare(model)
@model = model
messages = []
if packaging_folder_dirty?
messages << "The temporary backup folder still contains files!\n'\#{ File.join(Config.tmp_path, @model.trigger) }'\nThese files will now be removed.\n"
FileUtils.rm_rf(File.join(Config.tmp_path, @model.trigger))
end
package_files = tmp_path_package_files
unless package_files.empty?
messages << ('-' * 74) unless messages.empty?
messages << "The temporary backup folder '\#{ Config.tmp_path }'\nappears to contain the package files from the previous backup!\n\#{ package_files.join(\"\\n\") }\nThese files will now be removed.\n"
package_files.each {|file| FileUtils.rm_f(file) }
end
unless messages.empty?
Logger.warn Errors::CleanerError.new("Cleanup Warning\n\#{ messages.join(\"\\n\") }\nPlease check the log for messages and/or your notifications\nconcerning this backup: '\#{ @model.label } (\#{ @model.trigger })'\nThe temporary files which had to be removed should not have existed.\n")
end
end