[Pkg-zsh-devel] Bug#707760: zsh: Alternatives broken for long time during upgrade from zsh4 to zsh5

Axel Beckert abe at debian.org
Thu Oct 9 22:35:14 UTC 2014


Hi,

Frank Terbeck wrote:
> Axel Beckert wrote:
> > Sven Joachim wrote:
> [...]
> >> How about adding a symlink /bin/zsh4 -> zsh5 in the zsh package?  Not
> >> extremely pretty, but it should work.
> >
> > What about putting a shell script at /bin/zsh4 which more or less
> > looks this?
> >
> >   #!/bin/sh
> >   
> >   echo "$0 is deprecated, please switch to /bin/zsh or /usr/bin/zsh" 1>&2
> >   exec /bin/zsh5 "$@"
> 
> I think this is the way to go. Maybe even like this:
> 
> #!/bin/zsh -f
> 
> if [[ -o interactive ]]; then
>     echo "$0 is deprecated, please switch to /bin/zsh or /usr/bin/zsh" 1>&2
>     echo "Use: chsh -s /bin/zsh" 1>&2
>     echo "This command ($0) will disappear eventually!" 1>&2
> fi
> exec /bin/zsh "$@"

Good idea!

I have one more refinement: Since during the upgrade /bin/zsh will be
symlinked to this script (i.e. the reason for this bug report), it
should also check if $0 contains zsh4. So I'll likely later add a
script like this one:

#!/bin/zsh -f

if [[ -o interactive && $0 == *zsh4* ]]; then
    echo "$0 is deprecated, please switch to /bin/zsh or /usr/bin/zsh" 1>&2
    echo "Use: chsh -s /bin/zsh" 1>&2
    echo "This command ($0) will disappear eventually!" 1>&2
fi
exec /bin/zsh "$@"

		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe at debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5



More information about the Pkg-zsh-devel mailing list