summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorNicholas Guriev <guriev-ns@ya.ru>2019-06-24 22:21:53 +0300
committerNicholas Guriev <guriev-ns@ya.ru>2019-06-24 22:21:53 +0300
commitc2075fff759a2650b9272e5e37cec0daa514987c (patch)
tree176c0f18b11d818a9d655d7d0acb6fda5729554a /debian
parent04045fdddb750991fe6a0842f427ac0ff047398f (diff)
Do not remove entire /usr/share/doc/HTML
Closes: #929850
Diffstat (limited to 'debian')
-rwxr-xr-xdebian/prerm27
1 files changed, 21 insertions, 6 deletions
diff --git a/debian/prerm b/debian/prerm
index 4597b9f..ab948e6 100755
--- a/debian/prerm
+++ b/debian/prerm
@@ -24,6 +24,9 @@ set -e
#### Globals ####
+line_feed="
+"
+
#### Import Library ####
# If old version's prerm fails, our files (and thus the script library)
@@ -55,6 +58,24 @@ do_removal_cleanup_actions ()
# The directories themselves will be removed by dpkg;
# cf. our debian/dirs entries.
+ # Remove html document index directory contents.
+
+ if [ -e /var/lib/dhelp/exported.list ]; then
+ local old_ifs="$IFS"
+ IFS="${line_feed}"
+ for entry in $(tac /var/lib/dhelp/exported.list); do
+ case "${entry}" in
+ */)
+ rmdir "${entry}" || true
+ ;;
+ *)
+ rm --force "${entry}"
+ ;;
+ esac
+ done
+ IFS="${old_ifs}"
+ fi
+
# Remove all cache data inside /var/lib/dhelp/tmp
if [ -d /var/lib/dhelp/tmp ]; then
@@ -68,12 +89,6 @@ do_removal_cleanup_actions ()
rm --force /var/lib/dhelp/* 2>&1 \
| grep --invert-match '/var/lib/dhelp/tmp' || true
fi
-
- # Remove html document index directory contents.
-
- if [ -d /usr/share/doc/HTML ]; then
- rm --force --recursive /usr/share/doc/HTML/*
- fi
}
#### Main script body ####