From: Michael Prokop Date: Tue, 29 May 2007 14:31:48 +0000 (+0200) Subject: /etc/zsh/zshrc and /etc/skel/.zshrc: some more checks whether the global file has... X-Git-Tag: 0.3.7~2 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=4f9cbb4bae166783f31b702b917ac3761aa34b2a /etc/zsh/zshrc and /etc/skel/.zshrc: some more checks whether the global file has been read --- diff --git a/debian/changelog b/debian/changelog index 1d5e5f6..cc579f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-etc-core (0.3.7) unstable; urgency=low + + * /etc/zsh/zshrc and /etc/skel/.zshrc: some more checks whether + the global file has been read. + + -- Michael Prokop Tue, 29 May 2007 16:31:19 +0200 + grml-etc-core (0.3.6) unstable; urgency=low * /etc/zsh/zshrc: do not even add completion directories if diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index e091eb5..9a885ff 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -3,7 +3,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Fre Mai 25 01:27:47 CEST 2007 [mika] +# Latest change: Die Mai 29 16:31:10 CEST 2007 [mika] ################################################################################ # source ~/.zshrc.global {{{ @@ -15,9 +15,15 @@ fi # }}} +# check whether global file has been read {{{ + if [ -z "$ZSHRC_GLOBAL_HAS_BEEN_READ" ] ; then + print 'Warning: global zsh config has not been read'>&2 + fi +# }}} + # autoloading stuff {{{ - # associate types and extensions: - autoload zsh-mime-setup && zsh-mime-setup +# associate types and extensions: + type zsh-mime-setup &>/dev/null || { autoload zsh-mime-setup && zsh-mime-setup } # }}} # completion system {{{ @@ -173,19 +179,21 @@ [ -d ~/.terminfo/ ] && alias man='TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man' # check whether Debian's package management (dpkg) is running - salias check_dpkg_running="dpkg_running" + type salias &>/dev/null && salias check_dpkg_running="dpkg_running" # work around non utf8 capable software in utf environment - if [ -x $(which mrxvt) ] ; then - isutfenv && [ -n "$LANG" ] && alias mrxvt="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} mrxvt" - fi - - if [ -x $(which aterm) ] ; then - isutfenv && [ -n "$LANG" ] && alias aterm="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} aterm" - fi - - if [ -x $(which centericq) ] ; then - isutfenv && [ -n "$LANG" ] && alias centericq="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} centericq" + if type isutfenv &>/dev/null ; then + if [ -x $(which mrxvt) ] ; then + isutfenv && [ -n "$LANG" ] && alias mrxvt="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} mrxvt" + fi + + if [ -x $(which aterm) ] ; then + isutfenv && [ -n "$LANG" ] && alias aterm="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} aterm" + fi + + if [ -x $(which centericq) ] ; then + isutfenv && [ -n "$LANG" ] && alias centericq="LANG=${LANG/(#b)(*)[.@]*/$match[1].iso885915} centericq" + fi fi # }}} @@ -244,7 +252,7 @@ # Function Usage: doc packagename doc() { cd /usr/share/doc/$1 && ls } _doc() { _files -W /usr/share/doc -/ } - compdef _doc doc + type compdef &>/dev/null && compdef _doc doc # make screenshot of current desktop (use 'import' from ImageMagic) sshot() { diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index d6a29f4..644070f 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3,7 +3,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Son Mai 27 19:12:26 CEST 2007 [mika] +# Latest change: Die Mai 29 16:30:03 CEST 2007 [mika] ################################################################################ # This file is sourced only for interactive shells. It # should contain commands to set up aliases, functions, @@ -1267,5 +1267,9 @@ If you want to use xinit anyway please call \"/usr/bin/xinit\"." fi # }}} +# add variable to be able to check whether the file has been read {{{ + ZSHRC_GLOBAL_HAS_BEEN_READ=1 +# }}} + ## END OF FILE ################################################################# # vim:foldmethod=marker expandtab