Do not backup files in install if the same is already in fs.

This commit is contained in:
Martin Edenhofer 2016-02-01 00:48:43 +01:00
parent c4206539d1
commit 99de6f801f

View file

@ -403,8 +403,13 @@ returns
def self._write_file(file, permission, data)
location = "#{@@root}/#{file}"
# rename existing file
# rename existing file if not already the same file
if File.exist?(location)
content_fs = _read_file(file)
if content_fs == data
logger.debug "NOTICE: file '#{location}' already exists, skip install"
return true
end
backup_location = location + '.save'
logger.info "NOTICE: backup old file '#{location}' to #{backup_location}"
File.rename(location, backup_location)