summary refs log tree commit diff
path: root/debian/dash.postinst
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.postinst
downloaddash-05c1076ba2d1a68fe7f3a5ae618f786b8898d327.tar.gz
dash-05c1076ba2d1a68fe7f3a5ae618f786b8898d327.zip
Initial import.
Diffstat (limited to 'debian/dash.postinst')
-rw-r--r--debian/dash.postinst92
1 files changed, 92 insertions, 0 deletions
diff --git a/debian/dash.postinst b/debian/dash.postinst
new file mode 100644
index 0000000..6dd59d1
--- /dev/null
+++ b/debian/dash.postinst
@@ -0,0 +1,92 @@
+#!/bin/sh
+#
+# post-install script for the Debian GNU/Linux dash package
+#
+# $Id$
+
+set -e
+
+check_divert() {
+	div=$(dpkg-divert --list $2)
+	distrib=${4:-$2.distrib}
+	case "$1" in
+	true)
+		if [ -z "$div" ]; then
+			dpkg-divert --package dash --divert $distrib --add $2
+			cp -dp $2 $distrib
+			ln -sf $3 $2
+		fi
+		;;
+	false)
+		if [ -n "$div" ] && [ -z "${div%%*by dash}" ]; then
+			mv $distrib $2
+			dpkg-divert --remove $2
+		fi
+		;;
+	ash)
+		case $div in
+		'')
+			;;
+		*by\ ash)
+			dst=${div% by ash}
+			dst=${dst##* to }
+
+			# Work around dpkg-divert bug.
+			if [ -e "$dst" ]; then
+				mv "$dst" "$dst.dash-tmp"
+			fi
+			dpkg-divert --remove $2
+			if [ -e "$dst.dash-tmp" ]; then
+				mv "$dst.dash-tmp" "$dst"
+			fi
+
+			dpkg-divert --package dash --divert $distrib --add $2
+			if [ "$dst" != $distrib ] && [ -e "$dst" ]; then
+				mv "$dst" $distrib
+			fi
+			ln -sf $3 $2
+			;;
+		*)
+			d=${2%/*}
+			if
+				[ -h $2 ] && [ -f $2 ] && [ -f $d/$5 ] &&
+				cmp $2 $d/$5
+			then
+				ln -sf $3 $2
+			fi
+			;;
+		esac
+	esac
+}
+
+add_shell() {
+	if ! type add-shell > /dev/null 2>&1; then
+		return
+	fi
+
+	add-shell /bin/dash
+}
+
+debconf=
+if [ -f /usr/share/debconf/confmodule ]; then
+	. /usr/share/debconf/confmodule
+	debconf=yes
+fi
+
+if [ "$1" = configure ] && [ -z "$2" ]; then
+	check_divert ash /bin/sh dash '' ash
+	check_divert ash /usr/share/man/man1/sh.1.gz dash.1.gz \
+		/usr/share/man/man1/sh.distrib.1.gz ash.1.gz
+	add_shell
+elif [ "$1" = configure ] && dpkg --compare-versions "$2" lt 0.4.18; then
+	add_shell
+fi
+
+if [ $debconf ]; then
+	db_get dash/sh
+	check_divert "$RET" /bin/sh dash
+	check_divert "$RET" /usr/share/man/man1/sh.1.gz dash.1.gz \
+		/usr/share/man/man1/sh.distrib.1.gz
+fi
+
+#DEBHELPER#
hat emacs offers... 2020-02-12Allow for arguments to open/copy utilitiesJune McEnroe 2020-02-12Handle RPL_AWAYJune McEnroe 2020-02-11Support monochromatic terminalsJune McEnroe Oops, division by zero! 2020-02-11Add .gz to chroot-man scriptJune McEnroe 2020-02-11Add -R restricted flagJune McEnroe 2020-02-11Add chroot targetJune McEnroe 2020-02-11Exit focus and paste modes on err exitJune McEnroe 2020-02-11Add startup GPLv3 note and URLJune McEnroe I am a degenerate. 2020-02-11Make sure -D_GNU_SOURCE ends up in CFLAGS on LinuxJune McEnroe 2020-02-11Add note about setting PKG_CONFIG_PATHJune McEnroe 2020-02-11Rename query ID on nick changeJune McEnroe 2020-02-11Call completeClear when closing a windowJune McEnroe 2020-02-11Don't insert color codes for non-mentionsJune McEnroe 2020-02-11Take first two words in colorMentionsJune McEnroe This lets phrases like "hi june" get colored, but still doesn't get carried away. 2020-02-11Use time_t for save signatureJune McEnroe It's actually more likely to be 64-bit than size_t anyway, and it eliminates some helper functions. Also don't error when reading an empty save file. 2020-02-11Set self.nick to * initiallyJune McEnroe Allows removing a bunch of checks that self.nick is set, and it's what the server usually calls you before registration. Never highlight notices as mentions. 2020-02-11Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe Rookie mistake. 2020-02-11Cast towupper to wchar_tJune McEnroe For some reason it takes and returns wint_t... 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe