summary refs log tree commit diff
path: root/debian/dash.prerm
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-09-26 18:32:28 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2005-09-26 18:32:28 +1000
commit05c1076ba2d1a68fe7f3a5ae618f786b8898d327 (patch)
tree8e3b5ecace201bfd29027ccb59110cc1d600ad37 /debian/dash.prerm
downloaddash-05c1076ba2d1a68fe7f3a5ae618f786b8898d327.tar.gz
dash-05c1076ba2d1a68fe7f3a5ae618f786b8898d327.zip
Initial import.
Diffstat (limited to '')
-rw-r--r--debian/dash.prerm36
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/dash.prerm b/debian/dash.prerm
new file mode 100644
index 0000000..8890367
--- /dev/null
+++ b/debian/dash.prerm
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# pre-removal script for the Debian GNU/Linux ash package
+#
+# $Id$
+
+set -e
+
+remove_divert() {
+	div=$(dpkg-divert --list $1)
+	if [ -n "$div" ] && [ -z "${div%%*by dash}" ]; then
+		distrib=${div% by dash}
+		distrib=${distrib##* to }
+		mv $distrib $1
+		dpkg-divert --remove $1
+	fi
+}
+
+remove_shell() {
+	if ! type remove-shell > /dev/null 2>&1; then
+		return
+	fi
+
+	remove-shell /bin/dash
+}
+
+if [ "$1" = remove ] || [ "$1" = deconfigure ]; then
+	remove_divert /bin/sh
+	remove_divert /usr/share/man/man1/sh.1.gz
+fi
+
+if [ "$1" = remove ]; then
+	remove_shell
+fi
+
+#DEBHELPER#