From 083363e908e5ed112b05601781d500ac6909599e Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Fri, 1 Feb 2008 02:13:09 +0100 Subject: [PATCH] zshrc: add a check for ZSH_VERSION >= 3.1.7 See . This commit quietly sets the required version of zsh to 3.1.7. If that test fails, we complain loudly. --- debian/changelog | 5 ++++- etc/skel/.zshrc | 3 +++ etc/zsh/zshrc | 27 +++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ce3d187..7e918c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,10 @@ grml-etc-core (0.3.48) unstable; urgency=low * use $PAGER in dchange(), uchange() and dnews() [Closes: issue386] * adding whatwhen() for history queries [Closes: issue380] - -- Frank Terbeck Thu, 31 Jan 2008 10:46:20 +0100 + [ Frank Terbeck ] + * zshrc: add a check for ZSH_VERSION >= 3.1.7 [Closes: issue389] + + -- Frank Terbeck Fri, 01 Feb 2008 02:11:31 +0100 grml-etc-core (0.3.47) unstable; urgency=low diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index 247e271..830df2f 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -24,6 +24,9 @@ if [[ -z "$ZSHRC_GLOBAL_HAS_BEEN_READ" ]] ; then print 'Warning: global zsh config has not been read.' >&2 print ' prepare for possible errors!' >&2 + print '' >&2 + print 'See our refcard for info on how to get the complete configuration:' >&2 + print ' ' >&2 fi # }}} diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index f9017c0..08940c6 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -331,6 +331,33 @@ isgrml && checkhome() { cd fi } + +# check for zsh v3.1.7+ + +if ! [[ ${ZSH_VERSION} == 3.1.<7->* \ + || ${ZSH_VERSION} == 3.<2->.<->* \ + || ${ZSH_VERSION} == <4->.<->* ]] ; then + + printf '-!-\n' + printf '-!- In this configuration we try to make use of features, that only\n' + printf '-!- require version 3.1.7 of the shell; That way this setup can be\n' + printf '-!- used with a wide range of zsh versions, while using fairly\n' + printf '-!- advanced features in all supported versions.\n' + printf '-!-\n' + printf '-!- However, you are running zsh version %s.\n' "$ZSH_VERSION" + printf '-!-\n' + printf '-!- While this *may* work, it might as well fail.\n' + printf '-!- Please consider updating to at least version 3.1.7 of zsh.\n' + printf '-!-\n' + printf '-!- DO NOT EXPECT THIS TO WORK FLAWLESSLY!\n' + printf '-!- If it does today, you'\''ve been lucky.\n' + printf '-!-\n' + printf '-!- Ye been warned!\n' + printf '-!-\n' + + function zstyle() { : } +fi + # }}} # {{{ set some variables -- 2.1.4