Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
hash_backup
Commits
3a581ef7
Commit
3a581ef7
authored
Mar 02, 2020
by
Anders Blomdell
Browse files
Improve symlink handling. Add missing import of shutil.
parent
b685d7d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
secondary.py
View file @
3a581ef7
...
...
@@ -8,6 +8,7 @@ import os
import
socket
import
subprocess
import
time
import
shutil
def
cond_unlink
(
path
,
log
):
try
:
...
...
@@ -88,10 +89,11 @@ class Backup:
dst
.
uid
,
dst
.
gid
)
os
.
lchown
(
dst_path
,
int
(
src
.
uid
),
int
(
src
.
gid
))
changed
=
True
if
src
.
kind
==
b
'F'
and
src
.
mtime
!=
dst
.
mtime
:
if
src
.
kind
in
[
b
'F'
,
b
'L'
]
and
src
.
mtime
!=
dst
.
mtime
:
self
.
log
.
DEBUG
(
'MTIME'
,
src
.
name
,
src
.
mtime
,
dst
.
mtime
)
atime
=
os
.
stat
(
dst_path
).
st_atime
os
.
utime
(
dst_path
,
(
int
(
atime
),
int
(
src
.
mtime
)))
atime
=
os
.
lstat
(
dst_path
).
st_atime
os
.
utime
(
dst_path
,
(
int
(
atime
),
int
(
src
.
mtime
)),
follow_symlinks
=
False
)
changed
=
True
if
changed
:
self
.
status
.
metadata
+=
1
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment