From 315a898e77af53b40dfc817606168490a40187b4 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 16 Nov 2020 14:25:16 +0100 Subject: [PATCH] enable force on install --- tests-ng/chmod-install.sh | 4 ++-- tests-ng/corner-case.sh | 2 ++ tests-ng/globs.sh | 2 +- tests-ng/import-configs.sh | 2 +- tests-ng/import-with-empty.sh | 4 ++-- tests-ng/include-order.sh | 1 + tests-ng/install-empty.sh | 2 +- tests-ng/install-ignore.sh | 8 ++++---- tests-ng/install-to-temp.sh | 2 +- tests-ng/macro-with-globals.sh | 2 +- 10 files changed, 16 insertions(+), 13 deletions(-) diff --git a/tests-ng/chmod-install.sh b/tests-ng/chmod-install.sh index bd0259e..72853de 100755 --- a/tests-ng/chmod-install.sh +++ b/tests-ng/chmod-install.sh @@ -242,7 +242,7 @@ echo "nomode" > ${tmps}/dotfiles/nomode chmod 600 ${tmps}/dotfiles/nomode echo "nomode" > ${tmpd}/nomode chmod 600 ${tmpd}/nomode -cd ${ddpath} | ${bin} install -c ${cfg} -p p2 -V f_nomode +cd ${ddpath} | ${bin} install -c ${cfg} -f -p p2 -V f_nomode has_rights "${tmpd}/nomode" "600" ## no user confirmation with force @@ -262,7 +262,7 @@ echo "nomode" > ${tmps}/dotfiles/nomode chmod 600 ${tmps}/dotfiles/nomode echo "nomode" > ${tmpd}/nomode chmod 700 ${tmpd}/nomode -cd ${ddpath} | printf 'y\ny\n' | ${bin} install -c ${cfg} -p p2 -V f_nomode +cd ${ddpath} | printf 'y\ny\n' | ${bin} install -f -c ${cfg} -p p2 -V f_nomode has_rights "${tmpd}/nomode" "600" ## CLEANING diff --git a/tests-ng/corner-case.sh b/tests-ng/corner-case.sh index 9c4b037..e5fb665 100755 --- a/tests-ng/corner-case.sh +++ b/tests-ng/corner-case.sh @@ -56,6 +56,8 @@ basedir=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` echo "[+] dotdrop dir: ${basedir}" echo "[+] dotpath dir: ${basedir}/dotfiles" +export DOTDROP_WORKERS=1 + # create the config file cfg="${basedir}/config.yaml" cat > ${cfg} << _EOF diff --git a/tests-ng/globs.sh b/tests-ng/globs.sh index a682961..d38915f 100755 --- a/tests-ng/globs.sh +++ b/tests-ng/globs.sh @@ -98,7 +98,7 @@ mkdir -p ${tmps}/dotfiles/ echo "abc" > ${tmps}/dotfiles/abc # install -cd ${ddpath} | ${bin} install -c ${cfg} -p p1 -V +cd ${ddpath} | ${bin} install -c ${cfg} -f -p p1 -V # checks [ ! -e ${tmpd}/abc ] && echo "dotfile not installed" && exit 1 diff --git a/tests-ng/import-configs.sh b/tests-ng/import-configs.sh index 2328fad..41a45e8 100755 --- a/tests-ng/import-configs.sh +++ b/tests-ng/import-configs.sh @@ -143,7 +143,7 @@ cd ${ddpath} | ${bin} files -c ${cfg1} -p pup -V | grep f_sub cd ${ddpath} | ${bin} files -c ${cfg1} -p psubsub -V | grep f_sub # test compare too -cd ${ddpath} | ${bin} install -c ${cfg1} -p p2 -V +cd ${ddpath} | ${bin} install -c ${cfg1} -p p2 -V -f cd ${ddpath} | ${bin} compare -c ${cfg1} -p p2 -V # test with non-existing dotpath this time diff --git a/tests-ng/import-with-empty.sh b/tests-ng/import-with-empty.sh index b43fb93..8937313 100755 --- a/tests-ng/import-with-empty.sh +++ b/tests-ng/import-with-empty.sh @@ -97,9 +97,9 @@ cd ${ddpath} | ${bin} import -c ${cfg} -p p1 --verbose ${dftoimport} [ "$?" != "0" ] && exit 1 echo "[+] install" -cd ${ddpath} | ${bin} install -c ${cfg} -p p1 --verbose | grep '^5 dotfile(s) installed.$' +cd ${ddpath} | ${bin} install -c ${cfg} -f -p p1 --verbose | grep '^5 dotfile(s) installed.$' rm -f ${dftoimport} -cd ${ddpath} | ${bin} install -c ${cfg} -p p1 --verbose | grep '^6 dotfile(s) installed.$' +cd ${ddpath} | ${bin} install -c ${cfg} -f -p p1 --verbose | grep '^6 dotfile(s) installed.$' nb=`cd ${ddpath} | ${bin} files -c ${cfg} -p p1 --verbose | grep '^[a-zA-Z]' | wc -l` [ "${nb}" != "6" ] && echo 'error in dotfile list' && exit 1 diff --git a/tests-ng/include-order.sh b/tests-ng/include-order.sh index 01c295a..471edf9 100755 --- a/tests-ng/include-order.sh +++ b/tests-ng/include-order.sh @@ -55,6 +55,7 @@ tmpd=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` # temporary tmpa=`mktemp -d --suffix='-dotdrop-tests' || mktemp -d` +export DOTDROP_WORKERS=1 # create the config file cfg="${tmps}/config.yaml" diff --git a/tests-ng/install-empty.sh b/tests-ng/install-empty.sh index 6773ca7..8ca2ff3 100755 --- a/tests-ng/install-empty.sh +++ b/tests-ng/install-empty.sh @@ -87,7 +87,7 @@ profiles: _EOF echo "[+] install" -cd ${ddpath} | ${bin} install -c ${cfg} -p p1 --verbose | grep '^5 dotfile(s) installed.$' +cd ${ddpath} | ${bin} install -c ${cfg} -f -p p1 --verbose | grep '^5 dotfile(s) installed.$' [ "$?" != "0" ] && exit 1 ## CLEANING diff --git a/tests-ng/install-ignore.sh b/tests-ng/install-ignore.sh index fd62890..76258ec 100755 --- a/tests-ng/install-ignore.sh +++ b/tests-ng/install-ignore.sh @@ -82,7 +82,7 @@ echo "new data" > ${basedir}/dotfiles/${tmpd}/readmes/README.md # install rm -rf ${tmpd} echo "[+] install normal" -cd ${ddpath} | ${bin} install --showdiff -c ${cfg} --verbose +cd ${ddpath} | ${bin} install --showdiff -c ${cfg} --verbose -f [ "$?" != "0" ] && exit 1 nb=`find ${tmpd} -iname 'README.md' | wc -l` echo "(1) found ${nb} README.md file(s)" @@ -96,7 +96,7 @@ cat ${cfg2} # install rm -rf ${tmpd} echo "[+] install with ignore in dotfile" -cd ${ddpath} | ${bin} install -c ${cfg2} --verbose +cd ${ddpath} | ${bin} install -c ${cfg2} --verbose -f [ "$?" != "0" ] && exit 1 nb=`find ${tmpd} -iname 'README.md' | wc -l` echo "(2) found ${nb} README.md file(s)" @@ -110,7 +110,7 @@ cat ${cfg2} # install rm -rf ${tmpd} echo "[+] install with ignore in config" -cd ${ddpath} | ${bin} install -c ${cfg2} --verbose +cd ${ddpath} | ${bin} install -c ${cfg2} --verbose -f [ "$?" != "0" ] && exit 1 nb=`find ${tmpd} -iname 'README.md' | wc -l` echo "(3) found ${nb} README.md file(s)" @@ -118,7 +118,7 @@ echo "(3) found ${nb} README.md file(s)" ## reinstall to trigger showdiff echo "showdiff" > ${tmpd}/program/a -cd ${ddpath} | echo "y" | ${bin} install --showdiff -c ${cfg} --verbose +cd ${ddpath} | echo "y" | ${bin} install --showdiff -c ${cfg} --verbose -f [ "$?" != "0" ] && exit 1 ## CLEANING diff --git a/tests-ng/install-to-temp.sh b/tests-ng/install-to-temp.sh index d8e95f2..7ffa49c 100755 --- a/tests-ng/install-to-temp.sh +++ b/tests-ng/install-to-temp.sh @@ -84,7 +84,7 @@ echo 'test_y' > ${basedir}/dotfiles/y echo "00000000 01 02 03 04 05" | xxd -r - ${basedir}/dotfiles/z echo "[+] install" -cd ${ddpath} | ${bin} install -c ${cfg} -p p1 --showdiff --verbose --temp | grep '^3 dotfile(s) installed.$' +cd ${ddpath} | ${bin} install -f -c ${cfg} -p p1 --showdiff --verbose --temp | grep '^3 dotfile(s) installed.$' [ "$?" != "0" ] && exit 1 ## CLEANING diff --git a/tests-ng/macro-with-globals.sh b/tests-ng/macro-with-globals.sh index 48bb1d3..f29b6f3 100755 --- a/tests-ng/macro-with-globals.sh +++ b/tests-ng/macro-with-globals.sh @@ -88,7 +88,7 @@ cat > ${tmps}/dotfiles/abc << _EOF _EOF # install -cd ${ddpath} | ${bin} install -c ${cfg} -p p0 -V +cd ${ddpath} | ${bin} install -c ${cfg} -p p0 -V -f # test file content cat ${tmpd}/abc