diff options
author | 2009-04-09 04:38:27 +0000 | |
---|---|---|
committer | 2009-04-09 04:38:27 +0000 | |
commit | 5aeb538d6ee6c9e94fa7ab5a91d9b508c69bd645 (patch) | |
tree | 730c64d566f377ccd949cc866546b63d4418016a | |
parent | Stable for HPPA (bug #260817). (diff) | |
download | gentoo-2-5aeb538d6ee6c9e94fa7ab5a91d9b508c69bd645.tar.gz gentoo-2-5aeb538d6ee6c9e94fa7ab5a91d9b508c69bd645.tar.bz2 gentoo-2-5aeb538d6ee6c9e94fa7ab5a91d9b508c69bd645.zip |
Version bump, bug 265240. Big thanks to ColdWind for re-working the awk split in the ebuild
(Portage version: 2.1.6.11/cvs/Linux x86_64)
-rw-r--r-- | app-shells/bash-completion/ChangeLog | 9 | ||||
-rw-r--r-- | app-shells/bash-completion/bash-completion-1.0.ebuild | 90 | ||||
-rw-r--r-- | app-shells/bash-completion/files/bash-completion-1.0-gentoo.patch | 58 |
3 files changed, 156 insertions, 1 deletions
diff --git a/app-shells/bash-completion/ChangeLog b/app-shells/bash-completion/ChangeLog index 83318a57baf3..33f61f63d568 100644 --- a/app-shells/bash-completion/ChangeLog +++ b/app-shells/bash-completion/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-shells/bash-completion # Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash-completion/ChangeLog,v 1.164 2009/04/07 04:20:22 darkside Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash-completion/ChangeLog,v 1.165 2009/04/09 04:38:24 darkside Exp $ + +*bash-completion-1.0 (09 Apr 2009) + + 09 Apr 2009; Jeremy Olexa <darkside@gentoo.org> + +files/bash-completion-1.0-gentoo.patch, +bash-completion-1.0.ebuild: + Version bump, bug 265240. Big thanks to ColdWind for re-working the awk + split in the ebuild 07 Apr 2009; Jeremy Olexa <darkside@gentoo.org> -files/20050121/01_all_gkrellm.diff, -files/20050121/03_all_timidity.diff, diff --git a/app-shells/bash-completion/bash-completion-1.0.ebuild b/app-shells/bash-completion/bash-completion-1.0.ebuild new file mode 100644 index 000000000000..dc487a34e0ae --- /dev/null +++ b/app-shells/bash-completion/bash-completion-1.0.ebuild @@ -0,0 +1,90 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash-completion/bash-completion-1.0.ebuild,v 1.1 2009/04/09 04:38:24 darkside Exp $ + +EAPI="2" + +inherit eutils + +DESCRIPTION="Programmable Completion for bash" +HOMEPAGE="http://bash-completion.alioth.debian.org/" +SRC_URI="mirror://debian/pool/main/b/bash-completion/${PN}_${PV}.orig.tar.gz -> +bash-completion-1.0.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" +IUSE="" + +DEPEND="" +RDEPEND="app-admin/eselect + || ( + >=app-shells/bash-2.05a + app-shells/zsh + )" +PDEPEND="app-shells/gentoo-bashcomp" + +src_prepare() { + epatch "${FILESDIR}/${PN}-1.0-gentoo.patch" +} + +src_install() { + emake DESTDIR="${D}" install || die + + # Upstream will soon be splitting this for us. + # split /etc/bash_completion into three parts: + # 1. /usr/share/bash-completion/.pre -- hidden from eselect + # 2. /usr/share/bash-completion/base -- 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" } + /^# start of section containing completion functions called by other functions/ { out=".pre" } + /^# start of section containing completion functions for bash built-ins/ { 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" + + dodir /etc/profile.d + cp bash_completion.sh "${D}/etc/profile.d/" || die "cp failed" + + dodoc AUTHORS CHANGES README TODO || die "dodocs failes" + + # bug 146726 + rm "${D}/etc/bash_completion.d/svk" || die "rm failed" + + # Upstream provides no easy way to move modules. sigh + dodir /usr/share/bash-completion + mv "${D}"/etc/bash_completion.d/* "${D}/usr/share/bash-completion/" \ + || die "installation failed to move files" + # cleanup the mess + rm -r "${D}"/etc/bash_completion{,.d} || die "rm failed" +} + +pkg_postinst() { + elog "Any user can enable the base completions without editing their" + elog ".bashrc by running:" + elog + elog " eselect bashcomp enable base" + elog + elog "The system administrator can also be enable this globally with" + elog + elog " eselect bashcomp enable --global base" + elog + elog "Additional completion functions can also be enabled or" + elog "disabled using eselect's bashcomp module." + elog + elog "If you use non-login shells you still need to source" + elog "/etc/profile.d/bash-completion.sh in your ~/.bashrc." + + + if has_version 'app-shells/zsh' ; then + elog "If you are interested in using the provided bash completion functions with" + elog "zsh, valuable tips on the effective use of bashcompinit are available:" + elog " http://www.zsh.org/mla/workers/2003/msg00046.html" + #elog " http://zshwiki.org/ZshSwitchingTo" (doesn't exist) + elog + fi +} diff --git a/app-shells/bash-completion/files/bash-completion-1.0-gentoo.patch b/app-shells/bash-completion/files/bash-completion-1.0-gentoo.patch new file mode 100644 index 000000000000..1f0eaff60551 --- /dev/null +++ b/app-shells/bash-completion/files/bash-completion-1.0-gentoo.patch @@ -0,0 +1,58 @@ +Gentoo does something different than upstream. This patch allows multiple +directories to be sourced. Upstream is trying to come to a consensus on this +issue and it is expected to change. Therefore it is a moot point to send this +upstream now. + +--- bash_completion.sh.orig 2009-04-08 23:14:34.736632335 -0500 ++++ bash_completion.sh 2009-04-08 23:17:59.670875954 -0500 +@@ -4,9 +4,46 @@ + # Check for recent enough version of bash. + bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.} + if [ $bmajor -eq 2 -a $bminor '>' 04 ] || [ $bmajor -gt 2 ]; then +- if [ -r /etc/bash_completion ]; then +- # Source completion code. +- . /etc/bash_completion +- fi ++ _load_completions() { ++ declare f x loaded_pre=false ++ for f; do ++ if [[ -f $f ]]; then ++ # Prevent loading base twice, initially and via glob ++ if $loaded_pre && [[ $f == */base ]]; then ++ continue ++ fi ++ ++ # Some modules, including base, depend on the definitions ++ # in .pre. See the ebuild for how this is created. ++ if ! $loaded_pre; then ++ if [[ ${BASH_COMPLETION-unset} == unset ]]; then ++ BASH_COMPLETION=/usr/share/bash-completion/base ++ fi ++ 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 # not designed to be called more than once ++ } ++ ++ # 1. Load base, 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 ++ # This order is subject to change once upstream decides on something. ++ _load_completions \ ++ /etc/bash_completion.d/base \ ++ ~/.bash_completion.d/base \ ++ /etc/bash_completion.d/* \ ++ ~/.bash_completion.d/* \ ++ ~/.bash_completion + fi ++ + unset bash bminor bmajor |