Gentoo Archives: gentoo-commits

From: "Jeremy Olexa (darkside)" <darkside@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-shells/bash-completion/files: bash-completion.sh-gentoo-1.2
Date: Fri, 02 Jul 2010 15:07:42
Message-Id: 20100702150735.E5DC52CF3D@corvid.gentoo.org
1 darkside 10/07/02 15:07:35
2
3 Added: bash-completion.sh-gentoo-1.2
4 Log:
5 Upstream version bump. Tons of fixes/additions to available completions
6 (Portage version: 2.1.8.3/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 app-shells/bash-completion/files/bash-completion.sh-gentoo-1.2
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash-completion/files/bash-completion.sh-gentoo-1.2?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash-completion/files/bash-completion.sh-gentoo-1.2?rev=1.1&content-type=text/plain
13
14 Index: bash-completion.sh-gentoo-1.2
15 ===================================================================
16 # Copyright 1999-2009 Gentoo Foundation
17 # Distributed under the terms of the GNU General Public License, v2 or later
18 # $Header: /var/cvsroot/gentoo-x86/app-shells/bash-completion/files/bash-completion.sh-gentoo-1.2,v 1.1 2010/07/02 15:07:33 darkside Exp $
19
20 # Check for interactive bash and that we haven't already been sourced.
21 [ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION" ] && return
22
23 # Check for recent enough version of bash.
24 bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
25 if [ $bmajor -gt 3 ] || [ $bmajor -eq 3 -a $bminor -ge 2 ]; then
26 _load_completions() {
27 declare f x loaded_pre=false
28 for f; do
29 if [[ -f $f ]]; then
30 # Prevent loading base twice, initially and via glob
31 if $loaded_pre && [[ $f == */base ]]; then
32 continue
33 fi
34
35 # Some modules, including base, depend on the definitions
36 # in .pre. See the ebuild for how this is created.
37 if ! $loaded_pre; then
38 if [[ ${BASH_COMPLETION-unset} == unset ]]; then
39 BASH_COMPLETION="@GENTOO_PORTAGE_EPREFIX@/usr/share/bash-completion/base"
40 fi
41 source "@GENTOO_PORTAGE_EPREFIX@/usr/share/bash-completion/.pre"
42 loaded_pre=true
43 fi
44
45 source "$f"
46 fi
47 done
48
49 # Clean up
50 $loaded_pre && source "@GENTOO_PORTAGE_EPREFIX@/usr/share/bash-completion/.post"
51 unset -f _load_completions # not designed to be called more than once
52 }
53
54 # 1. Load base, if eselected. This was previously known as
55 # /etc/bash_completion
56 # 2. Load completion modules, maintained via eselect bashcomp --global
57 # 3. Load user completion modules, maintained via eselect bashcomp
58 # 4. Load user completion file last, overrides modules at user discretion
59 # This order is subject to change once upstream decides on something.
60 _load_completions \
61 "@GENTOO_PORTAGE_EPREFIX@/etc/bash_completion.d/base" \
62 ~/.bash_completion.d/base \
63 "@GENTOO_PORTAGE_EPREFIX@/etc/bash_completion.d/"* \
64 ~/.bash_completion.d/* \
65 ~/.bash_completion
66 fi
67 unset bash bmajor bminor