Show More
@@ -806,8 +806,9 b' def checksignature(func):' | |||
|
806 | 806 | |
|
807 | 807 | return check |
|
808 | 808 | |
|
809 | def copyfile(src, dest, hardlink=False): | |
|
810 |
|
|
|
809 | def copyfile(src, dest, hardlink=False, copystat=False): | |
|
810 | '''copy a file, preserving mode and optionally other stat info like | |
|
811 | atime/mtime''' | |
|
811 | 812 | if os.path.lexists(dest): |
|
812 | 813 | unlink(dest) |
|
813 | 814 | # hardlinks are problematic on CIFS, quietly ignore this flag |
@@ -820,10 +821,16 b' def copyfile(src, dest, hardlink=False):' | |||
|
820 | 821 | pass # fall back to normal copy |
|
821 | 822 | if os.path.islink(src): |
|
822 | 823 | os.symlink(os.readlink(src), dest) |
|
824 | # copytime is ignored for symlinks, but in general copytime isn't needed | |
|
825 | # for them anyway | |
|
823 | 826 | else: |
|
824 | 827 | try: |
|
825 | 828 | shutil.copyfile(src, dest) |
|
826 |
|
|
|
829 | if copystat: | |
|
830 | # copystat also copies mode | |
|
831 | shutil.copystat(src, dest) | |
|
832 | else: | |
|
833 | shutil.copymode(src, dest) | |
|
827 | 834 | except shutil.Error as inst: |
|
828 | 835 | raise Abort(str(inst)) |
|
829 | 836 |
General Comments 0
You need to be logged in to leave comments.
Login now