Replace 'set -x' with verbose output from cp / rm.

This commit is contained in:
0x1eef 2024-04-14 11:55:18 -03:00
parent d9ebb491b1
commit 71000adb5c

View file

@ -16,12 +16,13 @@ perform_update()
rev=$(cat "${revfile}") rev=$(cat "${revfile}")
add=$(doas -u _portzap ${libexec}/git-changed-files "${gitdir}" "${rev}") add=$(doas -u _portzap ${libexec}/git-changed-files "${gitdir}" "${rev}")
del=$(doas -u _portzap ${libexec}/git-removed-files "${gitdir}" "${rev}") del=$(doas -u _portzap ${libexec}/git-removed-files "${gitdir}" "${rev}")
set -x
for file in ${del}; do for file in ${del}; do
target="${installdir}/${file}" target="${installdir}/${file}"
parent=$(dirname "${target}") parent=$(dirname "${target}")
rm "${target}" printf "rm $(rm -vf ${target})"
find "${parent}" -type d -maxdepth 0 -empty -exec rm -rf {} \; if [ -e "${parent}" ]; then
find "${parent}" -type d -maxdepth 0 -empty -exec rm -vrf {} \;
fi
done done
for file in ${add}; do for file in ${add}; do
target="${installdir}/${file}" target="${installdir}/${file}"
@ -31,7 +32,7 @@ perform_update()
chown root:_portzap "${parent}" chown root:_portzap "${parent}"
chmod ${mode} "${parent}" chmod ${mode} "${parent}"
fi fi
cp "${file}" "${target}" cp -v "${file}" "${target}"
chown root:_portzap "${target}" chown root:_portzap "${target}"
chmod ${mode} "${target}" chmod ${mode} "${target}"
done done
@ -39,6 +40,9 @@ perform_update()
perform_install() perform_install()
{ {
mkdir -p "${installdir}"
chown root:_portzap "${installdir}"
chmod ${mode} "${installdir}"
find -s . \ find -s . \
-maxdepth 1 \ -maxdepth 1 \
-exec cp -Rfv {} "${installdir}" \; \ -exec cp -Rfv {} "${installdir}" \; \