diff options
author | Aaron LI <aly@aaronly.me> | 2018-06-03 20:33:00 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-06-03 20:33:00 +0800 |
commit | 458ebe0d55332db763790d0254f4eceb5817d6c8 (patch) | |
tree | d8f8bc3b4f4fa3acf578ad29d1a628de48080973 /dfly-update | |
parent | eeac46480591a06ec8beba6b1541d0f0081cfd5b (diff) | |
download | dfly-update-458ebe0d55332db763790d0254f4eceb5817d6c8.tar.bz2 |
Also remove the generated catman pages when the man page obsolete
Diffstat (limited to 'dfly-update')
-rwxr-xr-x | dfly-update | 10 |
1 files changed, 9 insertions, 1 deletions
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" |