diff options
author | Aron Griffis <agriffis@gentoo.org> | 2006-11-20 23:06:15 +0000 |
---|---|---|
committer | Aron Griffis <agriffis@gentoo.org> | 2006-11-20 23:06:15 +0000 |
commit | 2888d092d2be4af293d0da2e53470e256ff5543f (patch) | |
tree | b80de1ac0d040bdd8cbb7cc93f487147f4b39291 /app-shells | |
parent | mask net-analyzer/wireshark until sec-policy/selinux-wireshark is keyworded f... (diff) | |
download | gentoo-2-2888d092d2be4af293d0da2e53470e256ff5543f.tar.gz gentoo-2-2888d092d2be4af293d0da2e53470e256ff5543f.tar.bz2 gentoo-2-2888d092d2be4af293d0da2e53470e256ff5543f.zip |
Break /etc/bash_completion into /usr/share/bash-completion/{.pre,base,.post}
so that the base definitions can be eselected. Rename
/etc/profile.d/bash-completion to have a .sh extension so it's loaded
automatically by /etc/profile. This is okay because it doesn't do anything
until modules have been eselected. All of this makes it possible to
configure bash-completions entirely with eselect instead of needing to add
snippets to one's .bashrc
(Portage version: 2.1.2_rc1-r7)
Diffstat (limited to 'app-shells')
6 files changed, 157 insertions, 1 deletions
diff --git a/app-shells/bash-completion/ChangeLog b/app-shells/bash-completion/ChangeLog index c951548970c3..9dd00c78676b 100644 --- a/app-shells/bash-completion/ChangeLog +++ b/app-shells/bash-completion/ChangeLog @@ -1,6 +1,18 @@ # ChangeLog for app-shells/bash-completion # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash-completion/ChangeLog,v 1.133 2006/03/02 12:03:27 ka0ttic Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash-completion/ChangeLog,v 1.134 2006/11/20 23:06:15 agriffis Exp $ + +*bash-completion-20060301-r1 (20 Nov 2006) + + 20 Nov 2006; Aron Griffis <agriffis@gentoo.org> +files/bash-completion.sh, + +bash-completion-20060301-r1.ebuild: + Break /etc/bash_completion into /usr/share/bash-completion/{.pre,base,.post} + so that the base definitions can be eselected. Rename + /etc/profile.d/bash-completion to have a .sh extension so it's loaded + automatically by /etc/profile. This is okay because it doesn't do anything + until modules have been eselected. All of this makes it possible to + configure bash-completions entirely with eselect instead of needing to add + snippets to one's .bashrc *bash-completion-20060301 (02 Mar 2006) diff --git a/app-shells/bash-completion/bash-completion-20060301-r1.ebuild b/app-shells/bash-completion/bash-completion-20060301-r1.ebuild new file mode 100644 index 000000000000..50b1c70816e2 --- /dev/null +++ b/app-shells/bash-completion/bash-completion-20060301-r1.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash-completion/bash-completion-20060301-r1.ebuild,v 1.1 2006/11/20 23:06:15 agriffis Exp $ + +inherit eutils + +DESCRIPTION="Programmable Completion for bash" +HOMEPAGE="http://www.caliban.org/bash/index.shtml#completion" +SRC_URI="http://www.caliban.org/files/bash/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc-macos ~ppc64 ~s390 ~sparc ~x86" +IUSE="" + +DEPEND="" +RDEPEND="app-admin/eselect + || ( + >=app-shells/bash-2.05a + app-shells/zsh + )" +PDEPEND="app-shells/gentoo-bashcomp" + +S="${WORKDIR}/${PN/-/_}" + +src_unpack() { + unpack ${A} + cd ${S} + EPATCH_SUFFIX="diff" epatch ${FILESDIR}/20050721 + EPATCH_SUFFIX="diff" epatch ${FILESDIR}/${PV} +} + +src_install() { + # split /etc/bash_completion into three parts: + # 1. /usr/share/bash-completion/.pre -- hidden from eselect + # 2. /usr/share/bash-completion/default -- eselectable + # 3. /usr/share/bash-completion/.post -- hidden from eselect + dodir /usr/share/bash-completion + awk -v D="$D" ' + BEGIN { out=".pre" } + /^# A lot of the following one-liners/ { out="base" } + /^# source completion directory/ { out="" } + /^unset -f have/ { out=".post" } + out != "" { print > D"/usr/share/bash-completion/"out }' \ + bash_completion || die "failed to split bash_completion" + + exeinto /etc/profile.d + doexe ${FILESDIR}/bash-completion.sh || die "failed to install profile.d" + + # dev-util/subversion provides an extremely superior completion + rm contrib/subversion + insinto /usr/share/bash-completion + doins contrib/* || die "failed to install contrib completions" + + dodoc Changelog README +} + +pkg_preinst() { + # This file is now being installed as bash-completion.sh, so rename it + # first. That allows CONFIG_PROTECT to kick in properly + if [[ -f ${ROOT}/etc/profile.d/bash-completion && \ + ! -f ${ROOT}/etc/profile.d/bash-completion.sh ]] + then + mv ${ROOT}/etc/profile.d/bash-completion{,.sh} + fi +} + +pkg_postinst() { + einfo + einfo "Versions of bash-completion prior to 20060301-r1 required each user to" + einfo "explicitly source /etc/profile.d/bash-completion in ~/.bashrc. This" + einfo "was kludgy and inconsistent with the completion modules which are" + einfo "enabled with eselect bashcomp. Now any user can enable the base" + einfo "completions without editing their .bashrc by running" + einfo + einfo " eselect bashcomp enable base" + einfo + einfo "The system administrator can also be enable this globally with" + einfo + einfo " eselect bashcomp enable --global base" + einfo + einfo "Additional completion functions can also be enabled or" + einfo "disabled using eselect's bashcomp module." + einfo + + if has_version 'app-shells/zsh' ; then + einfo "If you are interested in using the provided bash completion functions with" + einfo "zsh, valuable tips on the effective use of bashcompinit are available:" + einfo " http://www.zsh.org/mla/workers/2003/msg00046.html" + einfo " http://zshwiki.org/ZshSwitchingTo" + einfo + fi +} diff --git a/app-shells/bash-completion/files/bash-completion.sh b/app-shells/bash-completion/files/bash-completion.sh new file mode 100644 index 000000000000..36a194508a4e --- /dev/null +++ b/app-shells/bash-completion/files/bash-completion.sh @@ -0,0 +1,44 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash-completion/files/bash-completion.sh,v 1.1 2006/11/20 23:06:15 agriffis Exp $ +# +# START bash completion -- do not remove this line + +# Need interactive bash with complete builtin +if [ -n "$PS1" -a -n "$BASH_VERSION" -a \ + "`type -t complete 2>/dev/null`" = builtin ] +then + _load_completions() { + declare f x loaded_pre=false + for f; do + if [[ -f $f ]]; then + # Some modules, including default, depend on the definitions + # in .pre. See the ebuild for how this is created. + if ! $loaded_pre; then + BASH_COMPLETION=/usr/share/bash-completion/base + source /usr/share/bash-completion/.pre + loaded_pre=true + fi + source "$f" + fi + done + + # Clean up + $loaded_pre && source /usr/share/bash-completion/.post + unset -f _load_completions + } + + # 1. Load defaults, if eselected. This was previously known as + # /etc/bash_completion + # 2. Load completion modules, maintained via eselect bashcomp --global + # 3. Load user completion modules, maintained via eselect bashcomp + # 4. Load user completion file last, overrides modules at user discretion + _load_completions \ + /etc/bash_completion.d/default \ + ~/.bash_completion.d/default \ + /etc/bash_completion.d/* \ + ~/.bash_completion.d/* \ + ~/.bash_completion +fi + +# END bash completion -- do not remove this line diff --git a/app-shells/bash-completion/files/digest-bash-completion-20050121-r10 b/app-shells/bash-completion/files/digest-bash-completion-20050121-r10 index 5b0dcdfbb97e..233abee193b8 100644 --- a/app-shells/bash-completion/files/digest-bash-completion-20050121-r10 +++ b/app-shells/bash-completion/files/digest-bash-completion-20050121-r10 @@ -1 +1,3 @@ MD5 fafeed562b01a8dee079eb851579f2d2 bash-completion-20050121.tar.bz2 90140 +RMD160 3804cb7b0824d69a45113caf83c3996266e60915 bash-completion-20050121.tar.bz2 90140 +SHA256 cef765204a7b507a38179156e2e6f0ca3a05797821b645fc58e33c5082587531 bash-completion-20050121.tar.bz2 90140 diff --git a/app-shells/bash-completion/files/digest-bash-completion-20050721 b/app-shells/bash-completion/files/digest-bash-completion-20050721 index fbea20fa8b67..036032235c84 100644 --- a/app-shells/bash-completion/files/digest-bash-completion-20050721 +++ b/app-shells/bash-completion/files/digest-bash-completion-20050721 @@ -1 +1,3 @@ MD5 4de9f0dee0663f08b5e24f64490e642e bash-completion-20050721.tar.bz2 92923 +RMD160 6e1c25572d68a832bca4974ca02fcce456ea0aca bash-completion-20050721.tar.bz2 92923 +SHA256 fdb632afeacfe07f5f67bfbfbbdc229a88abe9d4fe09305a46c549d76a3d855e bash-completion-20050721.tar.bz2 92923 diff --git a/app-shells/bash-completion/files/digest-bash-completion-20060301-r1 b/app-shells/bash-completion/files/digest-bash-completion-20060301-r1 new file mode 100644 index 000000000000..845b62873eb5 --- /dev/null +++ b/app-shells/bash-completion/files/digest-bash-completion-20060301-r1 @@ -0,0 +1,3 @@ +MD5 ed95a89f57357a42b8e4eb95487bf9d0 bash-completion-20060301.tar.bz2 102357 +RMD160 eaa9112289607bae51868f047a9673ee6f3e6a0c bash-completion-20060301.tar.bz2 102357 +SHA256 16727406bd3fbb6a23da375d4f3ca7c5d518afeb7dfb82c061a452eb7a93ceca bash-completion-20060301.tar.bz2 102357 |