From 71000adb5ca55c0bef943a8da6982a101f4a5c23 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sun, 14 Apr 2024 11:55:18 -0300 Subject: [PATCH] Replace 'set -x' with verbose output from cp / rm. --- libexec/portzap/portzap-install | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libexec/portzap/portzap-install b/libexec/portzap/portzap-install index 03595bf..5e54bc6 100755 --- a/libexec/portzap/portzap-install +++ b/libexec/portzap/portzap-install @@ -16,12 +16,13 @@ perform_update() rev=$(cat "${revfile}") add=$(doas -u _portzap ${libexec}/git-changed-files "${gitdir}" "${rev}") del=$(doas -u _portzap ${libexec}/git-removed-files "${gitdir}" "${rev}") - set -x for file in ${del}; do target="${installdir}/${file}" parent=$(dirname "${target}") - rm "${target}" - find "${parent}" -type d -maxdepth 0 -empty -exec rm -rf {} \; + printf "rm $(rm -vf ${target})" + if [ -e "${parent}" ]; then + find "${parent}" -type d -maxdepth 0 -empty -exec rm -vrf {} \; + fi done for file in ${add}; do target="${installdir}/${file}" @@ -31,7 +32,7 @@ perform_update() chown root:_portzap "${parent}" chmod ${mode} "${parent}" fi - cp "${file}" "${target}" + cp -v "${file}" "${target}" chown root:_portzap "${target}" chmod ${mode} "${target}" done @@ -39,6 +40,9 @@ perform_update() perform_install() { + mkdir -p "${installdir}" + chown root:_portzap "${installdir}" + chmod ${mode} "${installdir}" find -s . \ -maxdepth 1 \ -exec cp -Rfv {} "${installdir}" \; \