From: Frank Terbeck Date: Mon, 22 Jun 2009 19:23:19 +0000 (+0200) Subject: zsh: move completion.d and functions.d to usr/share X-Git-Tag: v0.3.73~7 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=b5070ac43c7fc3a280526aaa172a901862198c8b zsh: move completion.d and functions.d to usr/share 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. --- diff --git a/debian/changelog b/debian/changelog index 9e9dda2..30f05fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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. + * 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. - -- Frank Terbeck Wed, 08 Jul 2009 13:26:50 +0200 + -- Frank Terbeck Wed, 08 Jul 2009 13:33:56 +0200 grml-etc-core (0.3.72) unstable; urgency=low diff --git a/debian/dirs b/debian/dirs index 7c9906d..1197a6a 100644 --- a/debian/dirs +++ b/debian/dirs @@ -1,2 +1,3 @@ etc/skel etc/zsh +usr/share diff --git a/debian/rules b/debian/rules index c60a6d6..580cc6c 100755 --- a/debian/rules +++ b/debian/rules @@ -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/ + cp -a usr_share_grml/ debian/grml-etc-core/usr/share/grml # Build architecture-dependent files here. binary-arch: build install diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index f2e1b39..f7c332b 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -598,22 +598,16 @@ fi # 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 - unset fdir fi -fi +done +unset fdir func # support colors in less export LESS_TERMCAP_mb=$'\E[01;31m' diff --git a/etc/zsh/completion.d/_debian_rules b/usr_share_grml/zsh/completion/debian/_debian_rules similarity index 100% rename from etc/zsh/completion.d/_debian_rules rename to usr_share_grml/zsh/completion/debian/_debian_rules diff --git a/etc/zsh/completion.d/_grml-lang b/usr_share_grml/zsh/completion/grml/_grml-lang similarity index 100% rename from etc/zsh/completion.d/_grml-lang rename to usr_share_grml/zsh/completion/grml/_grml-lang diff --git a/etc/zsh/completion.d/_grml-wallpaper b/usr_share_grml/zsh/completion/grml/_grml-wallpaper similarity index 100% rename from etc/zsh/completion.d/_grml-wallpaper rename to usr_share_grml/zsh/completion/grml/_grml-wallpaper diff --git a/etc/zsh/completion.d/_grmlinitd b/usr_share_grml/zsh/completion/grml/_grmlinitd similarity index 100% rename from etc/zsh/completion.d/_grmlinitd rename to usr_share_grml/zsh/completion/grml/_grmlinitd diff --git a/etc/zsh/completion.d/_fbset b/usr_share_grml/zsh/completion/linux/_fbset similarity index 100% rename from etc/zsh/completion.d/_fbset rename to usr_share_grml/zsh/completion/linux/_fbset diff --git a/etc/zsh/completion.d/_iwconfig b/usr_share_grml/zsh/completion/linux/_iwconfig similarity index 100% rename from etc/zsh/completion.d/_iwconfig rename to usr_share_grml/zsh/completion/linux/_iwconfig diff --git a/etc/zsh/completion.d/_hg b/usr_share_grml/zsh/completion/unix/_hg similarity index 100% rename from etc/zsh/completion.d/_hg rename to usr_share_grml/zsh/completion/unix/_hg diff --git a/etc/zsh/functions.d/grml-wallpaper b/usr_share_grml/zsh/functions/grml/grml-wallpaper similarity index 100% rename from etc/zsh/functions.d/grml-wallpaper rename to usr_share_grml/zsh/functions/grml/grml-wallpaper