diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2016-01-31 20:20:28 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2016-05-06 18:14:07 +0200 |
commit | cafce99034a47d7b622b12d4ddae90742db4cf1f (patch) | |
tree | 3d2cede136d51d5ffdbfd088c657856fc55909f2 | |
parent | 64eed86bfd7c180f6722aafd74f673c2b073670f (diff) | |
download | zsh-cafce99034a47d7b622b12d4ddae90742db4cf1f.tar.gz zsh-cafce99034a47d7b622b12d4ddae90742db4cf1f.zip |
Remove usage of alternatives system for zsh, rzsh and zsh-static
This also fixes installation together with usrmerge, which fiddles
with the directory layout and makes /bin a symlink to /usr/bin against
all Unix tradition and violating FHS.
Closes: #768079
-rwxr-xr-x | debian/rules | 7 | ||||
-rw-r--r-- | debian/zsh-common.links | 1 | ||||
-rw-r--r-- | debian/zsh-static.install | 1 | ||||
-rw-r--r-- | debian/zsh-static.links | 2 | ||||
-rw-r--r-- | debian/zsh-static.lintian-overrides | 8 | ||||
-rw-r--r-- | debian/zsh-static.postinst | 2 | ||||
-rw-r--r-- | debian/zsh-static.prerm | 21 | ||||
-rw-r--r-- | debian/zsh.install | 1 | ||||
-rw-r--r-- | debian/zsh.links | 2 | ||||
-rw-r--r-- | debian/zsh.lintian-overrides | 2 | ||||
-rw-r--r-- | debian/zsh.postinst | 19 | ||||
-rw-r--r-- | debian/zsh.prerm | 24 | ||||
-rw-r--r-- | debian/zsh5 | 27 |
13 files changed, 56 insertions, 61 deletions
diff --git a/debian/rules b/debian/rules index a9e74c986..b0cd71859 100755 --- a/debian/rules +++ b/debian/rules @@ -125,7 +125,7 @@ binary-indep: build-indep binary-arch-dynamic /^#define FPATH_SUBDIRS/ { $$1=""; $$2=""; gsub(/[" ]/,""); tail=$$0; } \ END { printf "%s/%s\n", head, tail; };' \ obj/Src/zshpaths.h >obj/Src/zshpaths.temp - debian/zsh/bin/zsh5 -fc \ + debian/zsh/bin/zsh -fc \ 'setopt extendedglob; \ for i in debian/zsh-common/'`cat obj/Src/zshpaths.temp`'; do \ zcompile -U -M $$i.zwc $$i/*~*.zwc(^/); \ @@ -171,7 +171,6 @@ binary-arch-dynamic: build-arch cd obj && $(MAKE) install.bin DESTDIR=$(CURDIR)/debian/zsh INSTALL_PROGRAM='$(INSTALL_PROGRAM)' cd obj && $(MAKE) install.modules DESTDIR=$(CURDIR)/debian/zsh INSTALL_PROGRAM='$(INSTALL_PROGRAM)' - mv debian/zsh/bin/zsh debian/zsh/bin/zsh5 rm debian/zsh/bin/zsh-5.[0-9]* dh_bugfiles -pzsh @@ -202,7 +201,9 @@ binary-arch-static: build-static dh_install -pzsh-static dh_strip -pzsh-static - mv debian/zsh-static/bin/zsh debian/zsh-static/bin/zsh5-static + mv debian/zsh-static/bin/zsh debian/zsh-static/bin/zsh-static + mv debian/zsh-static/bin/zsh5 debian/zsh-static/bin/zsh5-static + sed -e 's:#!/bin/zsh:#!/bin/zsh-static:' -i debian/zsh-static/bin/zsh5-static dh_installchangelogs -pzsh-static diff --git a/debian/zsh-common.links b/debian/zsh-common.links deleted file mode 100644 index b695f6f4e..000000000 --- a/debian/zsh-common.links +++ /dev/null @@ -1 +0,0 @@ -/usr/share/man/man1/zsh.1.gz /usr/share/man/man1/zsh5.1.gz diff --git a/debian/zsh-static.install b/debian/zsh-static.install index 51a712325..4c32118de 100644 --- a/debian/zsh-static.install +++ b/debian/zsh-static.install @@ -1 +1,2 @@ obj-static/Src/zsh bin +debian/zsh5 bin diff --git a/debian/zsh-static.links b/debian/zsh-static.links index 1f4ad1e3e..32d05c099 100644 --- a/debian/zsh-static.links +++ b/debian/zsh-static.links @@ -1 +1 @@ -/usr/share/man/man1/zsh.1.gz /usr/share/man/man1/zsh5-static.1.gz +/usr/share/man/man1/zsh.1.gz /usr/share/man/man1/zsh-static.1.gz diff --git a/debian/zsh-static.lintian-overrides b/debian/zsh-static.lintian-overrides index 21a0ecb14..b1314facb 100644 --- a/debian/zsh-static.lintian-overrides +++ b/debian/zsh-static.lintian-overrides @@ -1,3 +1,5 @@ -zsh-static: embedded-library bin/zsh5-static: libm -zsh-static: embedded-library bin/zsh5-static: ncurses -zsh-static: package-contains-broken-symlink usr/share/man/man1/zsh5-static.1.gz zsh.1.gz +zsh-static: embedded-library bin/zsh-static: libm +zsh-static: embedded-library bin/zsh-static: ncurses +zsh-static: package-contains-broken-symlink usr/share/man/man1/zsh-static.1.gz zsh.1.gz +# Migration wrapper which is not meant to be used +zsh-static: binary-without-manpage bin/zsh5-static diff --git a/debian/zsh-static.postinst b/debian/zsh-static.postinst index e275a2cb3..2d04961d3 100644 --- a/debian/zsh-static.postinst +++ b/debian/zsh-static.postinst @@ -19,8 +19,8 @@ case "$1" in ;; esac -update-alternatives --install /bin/zsh-static zsh-static /bin/zsh5-static 41 update-alternatives --remove zsh-static /bin/zsh4-static +update-alternatives --remove zsh-static /bin/zsh5-static #DEBHELPER# diff --git a/debian/zsh-static.prerm b/debian/zsh-static.prerm deleted file mode 100644 index adbdf8caa..000000000 --- a/debian/zsh-static.prerm +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - remove|deconfigure) - update-alternatives --remove zsh-static /bin/zsh5-static - ;; - upgrade) - ;; - - failed-upgrade) - ;; - - *) - echo "prerm called with unknown argument \`$1'" >&2 - exit 0 - ;; -esac - -#DEBHELPER# diff --git a/debian/zsh.install b/debian/zsh.install new file mode 100644 index 000000000..cd31624f4 --- /dev/null +++ b/debian/zsh.install @@ -0,0 +1 @@ +debian/zsh5 bin diff --git a/debian/zsh.links b/debian/zsh.links index cb996f26c..324b0f2e0 100644 --- a/debian/zsh.links +++ b/debian/zsh.links @@ -1,3 +1,5 @@ /usr/share/doc/zsh-common/changelog.gz /usr/share/doc/zsh/changelog.gz /usr/share/doc/zsh-common/examples /usr/share/doc/zsh/examples /usr/share/doc/zsh-common /usr/share/doc/zsh/doc +/bin/zsh /bin/rzsh +/usr/share/man/man1/zsh.1.gz /usr/share/man/man1/rzsh.1.gz diff --git a/debian/zsh.lintian-overrides b/debian/zsh.lintian-overrides index f23c6a12c..c5cc7017a 100644 --- a/debian/zsh.lintian-overrides +++ b/debian/zsh.lintian-overrides @@ -1,2 +1,4 @@ # Only one of many files affected -> likely a false positive zsh: hardening-no-fortify-functions usr/lib*/zsh/*/zsh/zleparameter.so +# Migration wrapper which is not meant to be used +zsh: binary-without-manpage bin/zsh5 diff --git a/debian/zsh.postinst b/debian/zsh.postinst index 2ba220230..c9952016c 100644 --- a/debian/zsh.postinst +++ b/debian/zsh.postinst @@ -18,15 +18,20 @@ case "$1" in ;; esac -update-alternatives --remove zsh /usr/bin/zsh +# ksh alternatives update-alternatives --remove ksh /usr/bin/zsh update-alternatives --remove ksh /bin/zsh4 -update-alternatives --install /bin/zsh zsh /bin/zsh5 51 \ - --slave /usr/bin/zsh zsh-usrbin /bin/zsh5 -update-alternatives --install /bin/rzsh rzsh /bin/zsh5 51 \ - --slave /usr/share/man/man1/rzsh.1.gz rzsh.1.gz /usr/share/man/man1/zsh.1.gz -update-alternatives --remove zsh /bin/zsh4 -update-alternatives --remove rzsh /bin/zsh4 + +# Remove alternatives system for zsh in general +update-alternatives --remove zsh /bin/zsh5 +update-alternatives --remove rzsh /bin/zsh5 + +# New hardcoded symlinks which unfortunately can't be shipped inside +# the package itself since some people want to merge /bin and /usr/bin +# against FHS and all Unix tradition. +if [ ! -e /usr/bin/zsh -a ! -L /usr/bin/zsh ]; then + ln -s /bin/zsh /usr/bin/zsh +fi #DEBHELPER# diff --git a/debian/zsh.prerm b/debian/zsh.prerm deleted file mode 100644 index d49ec4699..000000000 --- a/debian/zsh.prerm +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -set -e - -case "$1" in - (remove|deconfigure) - update-alternatives --remove zsh /bin/zsh5 - update-alternatives --remove rzsh /bin/zsh5 - ;; - (upgrade) - ;; - - (failed-upgrade) - ;; - - (*) - echo "prerm called with unknown argument \`$1'" >&2 - exit 0 - ;; -esac - -#DEBHELPER# - -exit 0 diff --git a/debian/zsh5 b/debian/zsh5 new file mode 100644 index 000000000..91b831c5b --- /dev/null +++ b/debian/zsh5 @@ -0,0 +1,27 @@ +#!/bin/zsh -f + +# This wrapper's sole purpose is to ease the migration of zsh's binary +# location from /bin/zsh5 to /bin/zsh between Debian Jessie and +# Stretch since zsh no more uses the alternatives system as there is +# only one version of zsh left in Debian since Jessie. +# +# Related bug report: https://bugs.debian.org/768079 + +if [[ "$0" == *zsh5* ]]; then + static='' + if [[ "$0" == *static* ]]; then + static=-static + fi + + echo "" + echo " ####" + echo " #### $0 is deprecated, please switch to /bin/zsh${static} (or /usr/bin/zsh)" + if [[ "$1" == "-l" || "$0" == -* ]]; then + echo ' #### Use "chsh -s '"/bin/zsh${static}"'" to change your login shell' + fi + echo " #### This command ($0) will disappear eventually!" + echo " ####" + echo "" +fi 1>&2 + +exec "/bin/zsh${static}" "$@" |