From f55ac1b2e0e9246241c7ff03a5b1631ea2320b4d Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 12 Mar 2018 21:24:52 +0800 Subject: upgrade_install(): suppress showing of unmodified files --- dfly-update | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'dfly-update') diff --git a/dfly-update b/dfly-update index 779fef2..fca71a2 100755 --- a/dfly-update +++ b/dfly-update @@ -423,9 +423,8 @@ install_system() { for file in ${FILES_IGNORE}; do if [ -f "${file}" ]; then file2="${file}.${BAK_SUF}" - echo -n " * ${file} " cp -pf "${file}" "${file2}" # NOTE: do NOT use "mv" - echo "" + echo " * ${file} " fi done @@ -469,9 +468,8 @@ install_system() { for file in ${FILES_IGNORE}; do file2="${file}.${BAK_SUF}" if [ -f "${file2}" ]; then - echo -n " * ${file} " mv -f "${file2}" "${file}" - echo "" + echo " * ${file} " fi done echo " => DONE!" @@ -492,30 +490,27 @@ upgrade_system() { for file_etc in ${FILES_IGNORE}; do file_new="${etcdir}/${file_etc#/etc/}" if [ -f "${file_new}" ]; then - echo -n " * ${file_new} " rm -f "${file_new}" - echo "" + echo " * ${file_new} " fi done - echo " => Identifying new config files for installing/merging ..." + echo " => Identifying new/updated config files ..." (cd "${etcdir}" && find -s . -type f) | while read -r file; do file_etc="/etc/${file#./}" file_new="${etcdir}/${file#./}" - echo -n " * ${file_new} " if [ -f "${file_etc}" ]; then if cmp -s "${file_etc}" "${file_new}"; then rm -f "${file_new}" - echo "(same)" else mv "${file_new}" "${file_new}.${NEW_SUF}" - echo "[UPDATED]" + echo " * ${file_new} [UPDATED]" fi else - echo "[NEW]" + echo " * ${file_new} [NEW]" fi done - echo " => Coping new configurations over ..." + echo " => Installing new configurations ..." cpdup -o -u ${etcdir} /etc || exit ${EC_CPDUP} echo " => DONE!" rm -rf "${etcdir}" @@ -639,6 +634,7 @@ _EOF_ else echo "??? Your DragonFly is newer than remote ???" fi + echo "" # XXX: set the global variables for use in `cmd_fly()` _FILENAME="${_filename}" -- cgit v1.2.2