summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdebian/rules7
-rw-r--r--debian/zsh-common.links1
-rw-r--r--debian/zsh-static.install1
-rw-r--r--debian/zsh-static.lintian-overrides2
-rw-r--r--debian/zsh-static.postinst2
-rw-r--r--debian/zsh-static.prerm21
-rw-r--r--debian/zsh.install1
-rw-r--r--debian/zsh.lintian-overrides2
-rw-r--r--debian/zsh.postinst19
-rw-r--r--debian/zsh.prerm24
-rw-r--r--debian/zsh527
11 files changed, 50 insertions, 57 deletions
diff --git a/debian/rules b/debian/rules
index afdf5406c..c94eef57f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -127,7 +127,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(^/); \
@@ -173,7 +173,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
@@ -204,7 +203,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.lintian-overrides b/debian/zsh-static.lintian-overrides
index 21a0ecb14..68a294c7f 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
+# 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.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..843a8f357 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/rzsh5
+
+# 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}" "$@"