From 44115fa7d7036c16d509702b913265dde633abeb Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Tue, 17 Jul 2018 21:42:54 +0200 Subject: [PATCH] add debug to diff --- dotdrop/installer.py | 3 ++- dotdrop/utils.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dotdrop/installer.py b/dotdrop/installer.py index 0b05737..d95d8e2 100644 --- a/dotdrop/installer.py +++ b/dotdrop/installer.py @@ -219,7 +219,8 @@ class Installer: if ret: if self.debug: self.log.dbg('diffing {} and {}'.format(tmpdst, dst)) - diff = utils.diff(tmpdst, dst, raw=False, opts=opts) + diff = utils.diff(tmpdst, dst, raw=False, + opts=opts, debug=self.debug) if diff == '': retval = True, '' else: diff --git a/dotdrop/utils.py b/dotdrop/utils.py index 0038626..807d8ef 100644 --- a/dotdrop/utils.py +++ b/dotdrop/utils.py @@ -29,10 +29,10 @@ def run(cmd, raw=True, debug=False): return ''.join(lines) -def diff(src, dst, raw=True, opts=''): +def diff(src, dst, raw=True, opts='', debug=False): """call unix diff to compare two files""" cmd = 'diff -r {} \"{}\" \"{}\"'.format(opts, src, dst) - return run(shlex.split(cmd), raw=raw) + return run(shlex.split(cmd), raw=raw, debug=debug) def get_tmpdir():