1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-05 12:03:49 +00:00

adapt question to user for mode change

This commit is contained in:
deadc0de6
2020-11-15 10:58:46 +01:00
parent 908a006adc
commit a3c6abd32b

View File

@@ -578,6 +578,10 @@ class Installer:
# broken symlink
err = 'broken symlink {}'.format(dst)
return -1, err
if self.debug:
d = 'src mode {:o}, dst mode {:o}'
self.log.dbg(d.format(rights, dstrights))
diff = None
if self.diff:
diff = self._diff_before_write(src, dst,
@@ -748,15 +752,17 @@ class Installer:
return True
if not os.path.exists(src):
return True
cperms = utils.get_file_perm(src)
perms = utils.get_file_perm(dst)
if perms == cperms:
sperms = utils.get_file_perm(src)
dperms = utils.get_file_perm(dst)
if sperms == dperms:
return True
elif self.safe:
# this only happens if no
# chmod is provided
# and dst/src modes differ
if self.safe:
msg = 'Mode differs ({:o} and {:o} ({})'
msg = msg.format(cperms, perms, dst)
msg += ', continue'
msg = 'Set mode {:o} to \"{}\"'
msg = msg.format(sperms, dst)
if not self.log.ask(msg):
return False
return True