zshrc: Add a warning about the new zshrc setup files
authorFrank Terbeck <ft@bewatermyfriend.org>
Wed, 31 Dec 2008 11:12:59 +0000 (12:12 +0100)
committerFrank Terbeck <ft@bewatermyfriend.org>
Sun, 8 Feb 2009 12:32:01 +0000 (13:32 +0100)
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.

etc/skel/.zshrc.pre [new file with mode: 0644]
etc/zsh/zshrc

diff --git a/etc/skel/.zshrc.pre b/etc/skel/.zshrc.pre
new file mode 100644 (file)
index 0000000..b0d7e28
--- /dev/null
@@ -0,0 +1,2 @@
+# do not warn about old skel dot-files, if we are actually using the new ones.
+GRML_WARN_SKEL=0
index 2c01d27..bff9234 100644 (file)
@@ -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 <http://grml.org/console> 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