]> git.madduck.net Git - etc/zsh.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

add support for parts.d dirs
authormartin f. krafft <madduck@madduck.net>
Wed, 14 May 2008 19:47:02 +0000 (20:47 +0100)
committermartin f. krafft <madduck@madduck.net>
Wed, 14 May 2008 19:47:02 +0000 (20:47 +0100)
.zsh/rcsstub
.zsh/sourcedir
.zsh/zlogin/.gitignore [new file with mode: 0644]
.zsh/zlogout/.gitignore [new file with mode: 0644]
.zsh/zprofile/.gitignore [new file with mode: 0644]
.zsh/zprofile/40_zcompile
.zsh/zshenv/.gitignore [new file with mode: 0644]
.zsh/zshrc/.gitignore [new file with mode: 0644]
.zsh/zshrc/00_recompile

index 0f30dc62c94003ec223ea95f27ac709d5fdb6753..b7736deb022695d50efac8a7af5eb5d04a5859ff 100644 (file)
@@ -8,15 +8,21 @@
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
-. $ZDOTDIR/logging
-. $ZDOTDIR/util
-
 if [[ -o rcs ]]; then
+  source $ZDOTDIR/logging
+  source $ZDOTDIR/util
+  source $ZDOTDIR/sourcedir
+
 #  __do_debug && set -x || :
 
-  file="%1N"; file="${(%)file}"
-  . $ZDOTDIR/sourcedir
-  sourcedir $ZDOTDIR/${file#.}
+  _DIR=$ZDOTDIR/${${(%):-%1N}#.}
+  sourcedir $_DIR
+
+  if [[ -d $_DIR/parts.d ]]; then
+    sourcedir $_DIR/parts.d
+  fi
+
+  unset _DIR
 
 #  __do_debug && set +x || :
 fi
index 4ce51a8330985e0c93f766b9007539c9e58eae5f..bb90720a8de9e696fd21cad06bf8152b29abc7d3 100644 (file)
@@ -12,6 +12,7 @@
 
 sourcedir() {
   if [ ! -d "$1" ]; then
+    error "no such directory: $1"
     return 1
   fi
 #  debug "sourcing directory ${1#$ZDOTDIR/}"
@@ -20,7 +21,7 @@ sourcedir() {
       *~|*.bak|*.old|*.sw?|*.zwc|*.disabled) continue;;
     esac
 #    debug "  sourcing file $f"
-    . "$f"
+    source "$f"
   done
 }
 
diff --git a/.zsh/zlogin/.gitignore b/.zsh/zlogin/.gitignore
new file mode 100644 (file)
index 0000000..53363b0
--- /dev/null
@@ -0,0 +1 @@
+/parts.d
diff --git a/.zsh/zlogout/.gitignore b/.zsh/zlogout/.gitignore
new file mode 100644 (file)
index 0000000..53363b0
--- /dev/null
@@ -0,0 +1 @@
+/parts.d
diff --git a/.zsh/zprofile/.gitignore b/.zsh/zprofile/.gitignore
new file mode 100644 (file)
index 0000000..53363b0
--- /dev/null
@@ -0,0 +1 @@
+/parts.d
index 174a757d8c024b31ad1c7402554f1a6aad36ec29..925c3de06cdf8752d3857e5abd1d966a4c8e679d 100644 (file)
 
 if [ -n "$ZDOTDIR" ] && [ -d "$ZDOTDIR" ]; then
   rm -f $ZDOTDIR/**/*.zwc{,.old}(D.N)
-  for f ($ZDOTDIR/*(D.,@) $ZDOTDIR/**/*(.)) \
-    [[ $f:t != .gitignore ]] && zcompile $f
+  for f in $ZDOTDIR/*(D.,@) $ZDOTDIR/**/*(.); do
+    case "$f:t" in
+      .gitignore|.*.sw?) continue;;
+    esac
+    zcompile $f
+  done
 fi
 
 if [ -n "$ZVARDIR" ] && [ -d "$ZVARDIR" ]; then
   rm -f $ZVARDIR/**/*.zwc{,.old}(.N)
-  for f ($ZVARDIR/comp*(.N)) zcompile $f
+  for f in $ZVARDIR/comp*(.N); do
+    case "$f:t" in
+      .gitignore|.*.sw?) continue;;
+    esac
+    zcompile $f
+  done
 fi
 
 # vim:ft=zsh
diff --git a/.zsh/zshenv/.gitignore b/.zsh/zshenv/.gitignore
new file mode 100644 (file)
index 0000000..53363b0
--- /dev/null
@@ -0,0 +1 @@
+/parts.d
diff --git a/.zsh/zshrc/.gitignore b/.zsh/zshrc/.gitignore
new file mode 100644 (file)
index 0000000..53363b0
--- /dev/null
@@ -0,0 +1 @@
+/parts.d
index fabb2e5094f925850c24235b9ebff22703cb6dac..b72107233d58ab4a385e83041a4c394241d7decc 100644 (file)
@@ -8,7 +8,7 @@
 # Source repository: http://git.madduck.net/v/etc/zsh.git
 #
 
-zrecompile $ZDOTDIR/**(N) $ZVARDIR/**(N) | while read pre file post; do
+zrecompile $ZDOTDIR/**/*(/N) $ZVARDIR/**/*(/N) | while read pre file post; do
     case "$post" in
       succeeded*) rm -f "${file%:}".old;;
       *) :;;