Don't try to overwrite an existing file if the contents are identical#4604
Don't try to overwrite an existing file if the contents are identical#4604ocaisa wants to merge 3 commits intoeasybuilders:5.0.xfrom
Conversation
dffa4e6 to
601fc4c
Compare
|
Note that file permissions are not compared as part of Could this cause problems? |
This is a very good point imho, could result in unintended side effects/breakage? |
| if target_exists and path_exists and os.path.samefile(path, target_path): | ||
| _log.debug("Not copying %s to %s since files are identical", path, target_path) | ||
| # Don't copy them if they are already considered the same | ||
| elif target_exists and path_exists and os.path.isfile(target_path) and filecmp.cmp(path, target_path): |
There was a problem hiding this comment.
At the very least we should also check whether file permissions are the same as well before skipping the actual copy operation?
There was a problem hiding this comment.
Note that the permissions may have been changed later on by postinstallcmds or hooks or the normal EB change-permission step and thus permission differences should not be considered if the content is actually the same.
|
Closing this in favour of #4642 which I think is the real problem |
No description provided.