1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 15:39:43 +00:00
This commit is contained in:
deadc0de6
2020-11-09 15:16:53 +01:00
parent fc9c12c1b0
commit 4517c3902c
5 changed files with 7 additions and 6 deletions

View File

@@ -639,19 +639,19 @@ class CfgYaml:
if len(val) < 3:
err = 'bad format for chmod: {}'.format(val)
self._log.err(err)
raise YamlException('dotfile chmod error: {}'.format(err))
raise YamlException(err)
try:
int(val)
except Exception:
err = 'bad format for chmod: {}'.format(val)
self._log.err(err)
raise YamlException('dotfile chmod error: {}'.format(err))
raise YamlException(err)
for x in val:
y = int(x)
if y < 0 or y > 7:
err = 'bad format for chmod: {}'.format(val)
self._log.err(err)
raise YamlException('dotfile chmod error: {}'.format(err))
raise YamlException(err)
return new

View File

@@ -501,7 +501,7 @@ def cmd_importer(o):
shutil.copy2(dst, srcf)
chmod = None
if o.import_mode or perm&o.umask:
if o.import_mode or perm & o.umask:
# insert chmod
chmod = perm
retconf = o.conf.new(src, dst, linktype, chmod=chmod)

View File

@@ -80,7 +80,7 @@ Options:
-k --key Treat <path> as a dotfile key.
-l --link=<link> Link option (nolink|link|link_children).
-L --file-only Do not show diff but only the files that differ.
-m --preserve-mode Insert a chmod entry in the dotfile with its permissions.
-m --preserve-mode Insert a chmod entry in the dotfile with its mode.
-n --nodiff Do not diff when installing.
-p --profile=<profile> Specify the profile to use [default: {}].
-P --show-patch Provide a one-liner to manually patch template.

View File

@@ -308,7 +308,7 @@ def get_umask():
"""return current umask value"""
cur = os.umask(0)
os.umask(cur)
return 0o777-cur
return 0o777 - cur
def get_file_perm(path):

View File

@@ -132,6 +132,7 @@ def _fake_args():
args['--as'] = None
args['--file-only'] = False
args['--workers'] = 1
args['--preserve-mode'] = False
# cmds
args['profiles'] = False
args['files'] = False