zsh: move completion.d and functions.d to usr/share
authorFrank Terbeck <ft@bewatermyfriend.org>
Mon, 22 Jun 2009 19:23:19 +0000 (21:23 +0200)
committerFrank Terbeck <ft@bewatermyfriend.org>
Wed, 8 Jul 2009 11:45:25 +0000 (13:45 +0200)
Having an additional set of files in /etc sucks because there is no
reliable way to deal with removing files and user customizations in any
sane way.

Keeping completions and additional function files in usr/share makes a
lot more sense. This also gives us the opportunity to finally get rid of
one of the annoying warning-tests at the start of our zshrc.

12 files changed:
debian/changelog
debian/dirs
debian/rules
etc/zsh/zshrc
usr_share_grml/zsh/completion/debian/_debian_rules [moved from etc/zsh/completion.d/_debian_rules with 100% similarity]
usr_share_grml/zsh/completion/grml/_grml-lang [moved from etc/zsh/completion.d/_grml-lang with 100% similarity]
usr_share_grml/zsh/completion/grml/_grml-wallpaper [moved from etc/zsh/completion.d/_grml-wallpaper with 100% similarity]
usr_share_grml/zsh/completion/grml/_grmlinitd [moved from etc/zsh/completion.d/_grmlinitd with 100% similarity]
usr_share_grml/zsh/completion/linux/_fbset [moved from etc/zsh/completion.d/_fbset with 100% similarity]
usr_share_grml/zsh/completion/linux/_iwconfig [moved from etc/zsh/completion.d/_iwconfig with 100% similarity]
usr_share_grml/zsh/completion/unix/_hg [moved from etc/zsh/completion.d/_hg with 100% similarity]
usr_share_grml/zsh/functions/grml/grml-wallpaper [moved from etc/zsh/functions.d/grml-wallpaper with 100% similarity]

index 9e9dda2..30f05fd 100644 (file)
@@ -11,12 +11,13 @@ grml-etc-core (0.3.73) UNRELEASED; urgency=low
     [Closes: issue706]
   * zshrc: Set options a lot earlier and include noshwordsplit explicitly.
   * zshrc: Make functions insusceptible to user option settings.
     [Closes: issue706]
   * zshrc: Set options a lot earlier and include noshwordsplit explicitly.
   * zshrc: Make functions insusceptible to user option settings.
+  * zsh: move completion.d and functions.d to usr/share
 
   [ Michael Prokop ]
   * zshrc: add deborphan, pal and hnb to compdef _gnu_generic. Thanks for
     the suggestion to Carsten Hey.
 
 
   [ Michael Prokop ]
   * zshrc: add deborphan, pal and hnb to compdef _gnu_generic. Thanks for
     the suggestion to Carsten Hey.
 
- -- Frank Terbeck <ft@grml.org>  Wed, 08 Jul 2009 13:26:50 +0200
+ -- Frank Terbeck <ft@grml.org>  Wed, 08 Jul 2009 13:33:56 +0200
 
 grml-etc-core (0.3.72) unstable; urgency=low
 
 
 grml-etc-core (0.3.72) unstable; urgency=low
 
index 7c9906d..1197a6a 100644 (file)
@@ -1,2 +1,3 @@
 etc/skel
 etc/zsh
 etc/skel
 etc/zsh
+usr/share
index c60a6d6..580cc6c 100755 (executable)
@@ -29,6 +29,7 @@ install: build
 
        # Add here commands to install the package into debian/grml-etc-core.
        cp -a etc/ debian/grml-etc-core/
 
        # Add here commands to install the package into debian/grml-etc-core.
        cp -a etc/ debian/grml-etc-core/
+       cp -a usr_share_grml/ debian/grml-etc-core/usr/share/grml
 
 # Build architecture-dependent files here.
 binary-arch: build install
 
 # Build architecture-dependent files here.
 binary-arch: build install
index f2e1b39..f7c332b 100644 (file)
@@ -598,22 +598,16 @@ fi
 # do Fink setup on darwin
 isdarwin && xsource /sw/bin/init.sh
 
 # do Fink setup on darwin
 isdarwin && xsource /sw/bin/init.sh
 
-# completion functions go to /etc/zsh/completion.d
-# function files may be put into /etc/zsh/functions.d, from where they
-# will be automatically autoloaded.
-if [[ -n "$BROKEN_COMPLETION_DIR" ]] ; then
-    print 'Warning: not setting completion directories because broken files have been found.' >&2
-else
-    [[ -d /etc/zsh/completion.d ]] && fpath=( $fpath /etc/zsh/completion.d )
-    if [[ -d /etc/zsh/functions.d ]] ; then
-        fdir='/etc/zsh/functions.d'
-        fpath=( ${fdir} ${fdir}/**/*(/N) ${fpath} )
+# load our function and completion directories
+for fdir in /usr/share/grml/zsh/completion /usr/share/grml/functions; do
+    fpath=( ${fdir} ${fdir}/**/*(/N) ${fpath} )
+    if [[ ${fpath} == '/usr/share/grml/zsh/functions' ]] ; then
         for func in ${fdir}/**/[^_]*[^~](N.) ; do
             zrcautoload ${func:t}
         done
         for func in ${fdir}/**/[^_]*[^~](N.) ; do
             zrcautoload ${func:t}
         done
-        unset fdir
     fi
     fi
-fi
+done
+unset fdir func
 
 # support colors in less
 export LESS_TERMCAP_mb=$'\E[01;31m'
 
 # support colors in less
 export LESS_TERMCAP_mb=$'\E[01;31m'