From 126862bf6dda048fb3ec93497d08d2613bd82a04 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Thu, 28 May 2020 09:45:05 +0200 Subject: [PATCH] fix bug #233 --- dotdrop/comparator.py | 2 +- dotdrop/dotdrop.py | 4 ++-- tests-ng/import.sh | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dotdrop/comparator.py b/dotdrop/comparator.py index 8cd86cb..f29351f 100644 --- a/dotdrop/comparator.py +++ b/dotdrop/comparator.py @@ -79,7 +79,7 @@ class Comparator: if must_ignore([os.path.join(left, i)], ignore, debug=self.debug): continue - ret.append('=> \"{}\" does not exist on local\n'.format(i)) + ret.append('=> \"{}\" does not exist on destination\n'.format(i)) # handle files only in dotpath dir for i in comp.right_only: diff --git a/dotdrop/dotdrop.py b/dotdrop/dotdrop.py index 3625bd6..d2837bb 100644 --- a/dotdrop/dotdrop.py +++ b/dotdrop/dotdrop.py @@ -227,7 +227,7 @@ def cmd_compare(o, tmp): LOG.dbg('comparing {}'.format(dotfile)) src = dotfile.src if not os.path.lexists(os.path.expanduser(dotfile.dst)): - line = '=> compare {}: \"{}\" does not exist on local' + line = '=> compare {}: \"{}\" does not exist on destination' LOG.log(line.format(dotfile.key, dotfile.dst)) same = False continue @@ -421,7 +421,7 @@ def cmd_importer(o): LOG.err('importing \"{}\" failed!'.format(path)) ret = False continue - cmd = ['cp', '-R', '-L', dst, srcf] + cmd = ['cp', '-R', '-L', '-T', dst, srcf] if o.dry: LOG.dry('would run: {}'.format(' '.join(cmd))) else: diff --git a/tests-ng/import.sh b/tests-ng/import.sh index c499ea7..78ab6ff 100755 --- a/tests-ng/import.sh +++ b/tests-ng/import.sh @@ -90,6 +90,16 @@ nb=`cat ${cfg} | grep d_adir | wc -l` nb=`cat ${cfg} | grep f_file3 | wc -l` [ "${nb}" != "2" ] && echo 'bad config2' && exit 1 +cntpre=`find ${tmps}/dotfiles -type f | wc -l` + +# reimport +cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/adir +cd ${ddpath} | ${bin} import -c ${cfg} -p p1 -V ${tmpd}/file3 + +cntpost=`find ${tmps}/dotfiles -type f | wc -l` + +[ "${cntpost}" != "${cntpre}" ] && echo "import issue" && exit 1 + ## CLEANING rm -rf ${tmps} ${tmpd}