From 458ebe0d55332db763790d0254f4eceb5817d6c8 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 3 Jun 2018 20:33:00 +0800 Subject: Also remove the generated catman pages when the man page obsolete --- dfly-update | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dfly-update b/dfly-update index e767337..ef0aabd 100755 --- a/dfly-update +++ b/dfly-update @@ -523,7 +523,7 @@ upgrade_system() { cleanup() { [ $# -eq 0 ] || \ error ${EC_ARGS} "cleanup: invalid arguments: $@" - local mk_upgrade tmpfile item + local mk_upgrade tmpfile item itemcat mk_upgrade=/etc/upgrade/Makefile_upgrade.inc [ -e "${mk_upgrade}.${NEW_SUF}" ] && mk_upgrade=${mk_upgrade}.${NEW_SUF} tmpfile=$(mktemp -t ${NAME}) || exit ${EC_TMPFILE} @@ -540,6 +540,14 @@ cleanup() { chflags -Rf noschg ${item} rm -rf ${item} fi + if echo "${item}" | grep -q '/man/man[1-9]/'; then + itemcat=$(echo "${item}" | sed 's|/man/man|/man/cat|') + if [ -e "${itemcat}" ]; then + echo " * ${itemcat}" + chflags -Rf noschg ${itemcat} + rm -rf ${itemcat} + fi + fi done < ${tmpfile} rm -f ${tmpfile} echo "DONE" -- cgit v1.2.2