From 75c2158d2a7b1ae2def3c5b31dbbf33148225902 Mon Sep 17 00:00:00 2001 From: Sam Bingner Date: Fri, 29 Mar 2019 23:57:11 -1000 Subject: Make dpkg exec smarter; Update bash, tcsh, and zsh --- data/zsh/_metadata/depends | 1 + data/zsh/_metadata/postinst | 17 +++++++++++++++++ data/zsh/_metadata/prerm | 25 +++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 data/zsh/_metadata/depends create mode 100755 data/zsh/_metadata/postinst create mode 100755 data/zsh/_metadata/prerm (limited to 'data/zsh/_metadata') diff --git a/data/zsh/_metadata/depends b/data/zsh/_metadata/depends new file mode 100644 index 000000000..e089aacc5 --- /dev/null +++ b/data/zsh/_metadata/depends @@ -0,0 +1 @@ +dpkg (>= 1.18.25-10) diff --git a/data/zsh/_metadata/postinst b/data/zsh/_metadata/postinst new file mode 100755 index 000000000..70fa1d460 --- /dev/null +++ b/data/zsh/_metadata/postinst @@ -0,0 +1,17 @@ +#!/bin/zsh + +set -e + +if [ ! -e /bin/sh ]; then + ln -s zsh /bin/sh +fi + +case "$1" in + abort-remove|configure) + dpkg-divert --quiet --local --divert /bin/sh.distrib /bin/sh + update-alternatives --quiet --install /bin/sh sh /bin/zsh 100 || true + ;; + *) + exit 0 + ;; +esac diff --git a/data/zsh/_metadata/prerm b/data/zsh/_metadata/prerm new file mode 100755 index 000000000..bf7fadd2e --- /dev/null +++ b/data/zsh/_metadata/prerm @@ -0,0 +1,25 @@ +#!/bin/zsh + +set -e + +case "$1" in + upgrade) + ;; + + remove|deconfigure) + update-alternatives --quiet --remove sh /bin/zsh + dpkg-divert --quiet --remove /bin/sh + if [ ! -e /bin/sh ]; then + echo There would be no shell! + ln -s zsh /bin/sh + exit 1 + fi + ;; + + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac -- cgit v1.2.3