def get_hash (repo_rorp): """ Try to get a sha1 digest from the repository. If hardlinks are saved in the metadata, get the sha1 from the first hardlink """ Hardlink.add_rorp(repo_rorp) if Hardlink.islinked(repo_rorp): verify_sha1 = Hardlink.get_sha1(repo_rorp) elif repo_rorp.has_sha1(): verify_sha1 = repo_rorp.get_sha1() else: verify_sha1 = None Hardlink.del_rorp(repo_rorp) return verify_sha1
def pre_process(self, source_rorp, dest_rorp): """Do initial processing on source_rorp and dest_rorp It will not be clear whether source_rorp and dest_rorp have errors at this point, so don't do anything which assumes they will be backed up correctly. """ if Globals.preserve_hardlinks and source_rorp: Hardlink.add_rorp(source_rorp, dest_rorp) if (dest_rorp and dest_rorp.isdir() and Globals.process_uid != 0 and dest_rorp.getperms() % 01000 < 0700): self.unreadable_dir_init(source_rorp, dest_rorp)