]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
Add more debug output.
authorSimon Ruderich <simon@ruderich.org>
Sun, 8 Feb 2009 15:48:58 +0000 (16:48 +0100)
committerSimon Ruderich <simon@ruderich.org>
Mon, 16 Feb 2009 15:34:43 +0000 (16:34 +0100)
Useful when debugging which file gets loaded.

bash/rc
shell/env
tests/source_config.test.out
zsh/env
zsh/rc

diff --git a/bash/rc b/bash/rc
index 48b6433e26db05e0683514adfe64e6b75a0005a2..942ac8d957b144b9bca9d36c6c2bd7a957bd3004 100644 (file)
--- a/bash/rc
+++ b/bash/rc
@@ -7,12 +7,18 @@ host=$(echo $(hostname) | sed -e 's/\..*$//')
 # Load environmental related settings used by all shells.
 if [ -f ~/.shell/env ]; then
     source ~/.shell/env
+# Fallback functions as ~/.shell/env couldn't be loaded.
 else
+    function source_debug() {
+        echo $@
+    }
     function source_config() {
         echo "Couldn't load source_config(), can't source files." >&2
     }
 fi
 
+source_debug "sourcing ~/.bash/rc"
+
 # Load global env file for current hostname (first part before a dot) or
 # global env.local.
 source_config ~/.shell "" env $host
@@ -28,3 +34,5 @@ set -o vi
 
 # Load rc file for current hostname (first part before a dot) or rc.local.
 source_config ~/.bash host rc $host
+
+source_debug "finished sourcing ~/.bash/env"
index e30b2722e8de10547a182ff83dbeac2052202bc1..c654613b77a9c838b5284aa159cdecd3991a3fdf 100644 (file)
--- a/shell/env
+++ b/shell/env
@@ -12,6 +12,8 @@ function source_debug() {
 }
 
 
+source_debug "sourcing ~/.shell/env"
+
 # Use UTF-8 encoding in the terminal.
 LC_ALL=en_US.UTF-8
 LANG=$LC_ALL
@@ -112,5 +114,9 @@ function source_config() {
     elif [ -f $source_file_local -a x$5 != xnolocal ]; then
         source_debug "source_config(): sourcing $source_file_local"
         source $source_file_local
+    else
+        source_debug "source_config(): neither exists"
     fi
 }
+
+source_debug "finished sourcing ~/.shell/env"
index dcadd7fc79d410d8602e10231e1bc27e36c51ab7..7e1cec7ba51ce0ad9e8af315470e2202bd90123b 100644 (file)
@@ -13,12 +13,14 @@ source_config(): sourcing tmp/zsh/host/rc.zucker
 loaded zsh/host/rc.zucker
 source_config(): checking if tmp/zsh/os/env.Darwin exists
 source_config(): checking if tmp/zsh/env.local exists
+source_config(): neither exists
 source_config(): checking if tmp/zsh/host/env.zucker exists
 source_config(): checking if tmp/zsh/env.local exists
 source_config(): sourcing tmp/zsh/env.local
 loaded zsh.env.local
 source_config(): checking if tmp/bash/host/rc.zucker exists
 source_config(): checking if tmp/bash/rc.local exists
+source_config(): neither exists
 source_config(): checking if tmp/shell//env.zucker exists
 source_config(): checking if tmp/shell/env.local exists
 source_config(): sourcing tmp/shell//env.zucker
diff --git a/zsh/env b/zsh/env
index ade0f315102b3b347c0d93b65370385e2be7e4e5..365c01bfe8a172431d0d0e48b0618c42743fdeb6 100644 (file)
--- a/zsh/env
+++ b/zsh/env
@@ -7,12 +7,18 @@ host=${$(hostname)//.*/}
 # Load environmental related settings used by all shells.
 if [[ -f ~/.shell/env ]]; then
     source ~/.shell/env
+# Fallback functions as ~/.shell/env couldn't be loaded.
 else
+    function source_debug() {
+        echo $@
+    }
     function source_config() {
         echo "Couldn't load source_config(), can't source files." >&2
     }
 fi
 
+source_debug "sourcing ~/.zsh/env"
+
 # Load global env file for current hostname (first part before a dot) or
 # global env.local.
 source_config ~/.shell "" env $host
@@ -21,3 +27,5 @@ source_config ~/.shell "" env $host
 source_config ~/.zsh os env $(uname) nolocal
 # Load env file for current hostname (first part before a dot) or env.local.
 source_config ~/.zsh host env $host
+
+source_debug "finished sourcing ~/.zsh/env"
diff --git a/zsh/rc b/zsh/rc
index 69b19df10d66861c06dec31627b7b4e4e9203874..a7d62cc484ec6f6dec29cff93fe61e9081d4e817 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -1,6 +1,8 @@
 # Zsh configuration file.
 
 
+source_debug "sourcing ~/.zsh/rc"
+
 # MISCELLANEOUS SETTINGS
 
 # Use Vi(m) style key bindings.
@@ -296,3 +298,5 @@ todo() {
 source_config ~/.zsh os rc $(uname) nolocal
 # Load rc file for current hostname (first part before a dot) or rc.local.
 source_config ~/.zsh host rc ${$(hostname)//.*/}
+
+source_debug "finished sourcing ~/.zsh/rc"