Do not backup files in install if the same is already in fs.
This commit is contained in:
parent
c4206539d1
commit
99de6f801f
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue