From: Frank Terbeck Date: Wed, 31 Dec 2008 11:12:59 +0000 (+0100) Subject: zshrc: Add a warning about the new zshrc setup files X-Git-Tag: v0.3.62~19 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;h=8cb42cfe2092494e9fd8e1b9b1f24980296cf2d8;p=grml-etc-core.git zshrc: Add a warning about the new zshrc setup files Since a lot of people will have the .zshrc file from /etc/skel in their home directory, this should be the-right-thing-to-do[tm]. This adds /etc/skel/zshrc.pre to stop this warning, because it is useless on grml systems where an up-to-date set of skel files is used. --- diff --git a/etc/skel/.zshrc.pre b/etc/skel/.zshrc.pre new file mode 100644 index 0000000..b0d7e28 --- /dev/null +++ b/etc/skel/.zshrc.pre @@ -0,0 +1,2 @@ +# do not warn about old skel dot-files, if we are actually using the new ones. +GRML_WARN_SKEL=0 diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 2c01d27..bff9234 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -102,6 +102,40 @@ NOPRECMD=${NOPRECMD:-0} BATTERY=${BATTERY:-0} GRMLSMALL_SPECIFIC=${GRMLSMALL_SPECIFIC:-1} GRML_ALWAYS_LOAD_ALL=${GRML_ALWAYS_LOAD_ALL:-0} +GRML_WARN_SKEL=${GRML_WARN_SKEL:-1} + +if (( GRML_WARN_SKEL != 0 )) ; then + printf ' +Dear user, + +You updated grml'\''s zshrc which brings a major change. +The configuration is kept only in one file, being the global zshrc. +In the past, the configuration was split in two files, with the +second file being the .zshrc file from /etc/skel. + +If you have a .zshrc file in your home directory that originally +came from the skel directory, please remove it. This is also the case +if you followed earlier instructions from the grml-zsh-refcard or +from on non-grml systems. + +Please see the current grml-zsh-refcard for updated installation +information. In short, you don'\''t want a .zshrc.global file. Install +the global zshrc to ~/.zshrc and be done. + +If you need changes to the configuration, use ~/.zshrc.pre and +~/.zshrc.local. + +To remove this warning execute '\''grml_do_not_warn_skel'\''. + +' | more + +function grml_do_not_warn_skel() { + printf '# Do not warn about old skel dot-files anymore\n' >>! ~/.zshrc.pre + printf 'GRML_WARN_SKEL=0\n' >>! ~/.zshrc.pre +} + +fi + # }}} # {{{ check for version/system