From 4517c3902cd56df18919ddc7d253ac9cf9a0ffd3 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 9 Nov 2020 15:16:53 +0100 Subject: [PATCH] fix cicd --- dotdrop/cfg_yaml.py | 6 +++--- dotdrop/dotdrop.py | 2 +- dotdrop/options.py | 2 +- dotdrop/utils.py | 2 +- tests/helpers.py | 1 + 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dotdrop/cfg_yaml.py b/dotdrop/cfg_yaml.py index c3c5e7a..a25ad7a 100644 --- a/dotdrop/cfg_yaml.py +++ b/dotdrop/cfg_yaml.py @@ -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 diff --git a/dotdrop/dotdrop.py b/dotdrop/dotdrop.py index 6b87ff6..0e22968 100644 --- a/dotdrop/dotdrop.py +++ b/dotdrop/dotdrop.py @@ -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) diff --git a/dotdrop/options.py b/dotdrop/options.py index 3531b54..0cbe1c6 100644 --- a/dotdrop/options.py +++ b/dotdrop/options.py @@ -80,7 +80,7 @@ Options: -k --key Treat as a dotfile key. -l --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= Specify the profile to use [default: {}]. -P --show-patch Provide a one-liner to manually patch template. diff --git a/dotdrop/utils.py b/dotdrop/utils.py index 47acc9f..bc32990 100644 --- a/dotdrop/utils.py +++ b/dotdrop/utils.py @@ -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): diff --git a/tests/helpers.py b/tests/helpers.py index 8abb198..83c4800 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -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