src/modules/actions/file.py
changeset 2400 8786abc4c255
parent 2339 aa5954c06b9d
child 2476 25342deb3749
equal deleted inserted replaced
2399:9daf47deb9c7 2400:8786abc4c255
   443                 # If the action has been marked with a preserve attribute, and
   443                 # If the action has been marked with a preserve attribute, and
   444                 # the file exists and has a content hash different from what the
   444                 # the file exists and has a content hash different from what the
   445                 # system expected it to be, then we preserve the original file
   445                 # system expected it to be, then we preserve the original file
   446                 # in some way, depending on the value of preserve.  If the
   446                 # in some way, depending on the value of preserve.  If the
   447                 # action is an overlay, then we always overwrite.
   447                 # action is an overlay, then we always overwrite.
   448                 overlay = self.attrs.get("overlay", "false") == "true"
   448                 overlay = self.attrs.get("overlay") == "true"
   449                 if is_file and not overlay:
   449                 if is_file and not overlay:
   450                         chash, cdata = misc.get_data_digest(final_path)
   450                         chash, cdata = misc.get_data_digest(final_path)
   451                         if not orig or chash != orig.hash:
   451                         if not orig or chash != orig.hash:
   452                                 if pres_type in ("renameold", "renamenew"):
   452                                 if pres_type in ("renameold", "renamenew"):
   453                                         return pres_type
   453                                         return pres_type