1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-16 21:59:11 +00:00

fix sub chmod

This commit is contained in:
deadc0de6
2023-09-22 11:29:01 +02:00
committed by deadc0de
parent 77450c1a01
commit cf8bd39597

View File

@@ -190,6 +190,7 @@ class Installer:
def _apply_chmod_after_install(self, src, dst, ret, err, def _apply_chmod_after_install(self, src, dst, ret, err,
chmod=None, chmod=None,
is_sub=False,
force_chmod=False, force_chmod=False,
linktype=LinkTypes.NOLINK): linktype=LinkTypes.NOLINK):
""" """
@@ -200,11 +201,15 @@ class Installer:
- error (not r, err) - error (not r, err)
- aborted (not r, err) - aborted (not r, err)
- special keyword "preserve" - special keyword "preserve"
is_sub is used to specify if the file/dir is
part of a dotfile directory
""" """
apply_chmod = linktype in [LinkTypes.NOLINK, LinkTypes.LINK_CHILDREN] apply_chmod = linktype in [LinkTypes.NOLINK, LinkTypes.LINK_CHILDREN]
apply_chmod = apply_chmod and os.path.exists(dst) apply_chmod = apply_chmod and os.path.exists(dst)
apply_chmod = apply_chmod and (ret or (not ret and not err)) apply_chmod = apply_chmod and (ret or (not ret and not err))
apply_chmod = apply_chmod and chmod != CfgYaml.chmod_ignore apply_chmod = apply_chmod and chmod != CfgYaml.chmod_ignore
if is_sub:
chmod = None
if not apply_chmod: if not apply_chmod:
self.log.dbg('no chmod applied') self.log.dbg('no chmod applied')
return return
@@ -620,7 +625,7 @@ class Installer:
return res, err return res, err
self._apply_chmod_after_install(fpath, fdst, ret, err, self._apply_chmod_after_install(fpath, fdst, ret, err,
chmod=chmod) chmod=chmod, is_sub=True)
if res: if res:
# something got installed # something got installed