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-1.0-gentoo.patch
Date: Thu, 09 Apr 2009 04:38:29
Message-Id: E1Lrm20-0002dP-0M@stork.gentoo.org
1 darkside 09/04/09 04:38:28
2
3 Added: bash-completion-1.0-gentoo.patch
4 Log:
5 Version bump, bug 265240. Big thanks to ColdWind for re-working the awk split in the ebuild
6 (Portage version: 2.1.6.11/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 app-shells/bash-completion/files/bash-completion-1.0-gentoo.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-shells/bash-completion/files/bash-completion-1.0-gentoo.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-shells/bash-completion/files/bash-completion-1.0-gentoo.patch?rev=1.1&content-type=text/plain
13
14 Index: bash-completion-1.0-gentoo.patch
15 ===================================================================
16 Gentoo does something different than upstream. This patch allows multiple
17 directories to be sourced. Upstream is trying to come to a consensus on this
18 issue and it is expected to change. Therefore it is a moot point to send this
19 upstream now.
20
21 --- bash_completion.sh.orig 2009-04-08 23:14:34.736632335 -0500
22 +++ bash_completion.sh 2009-04-08 23:17:59.670875954 -0500
23 @@ -4,9 +4,46 @@
24 # Check for recent enough version of bash.
25 bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
26 if [ $bmajor -eq 2 -a $bminor '>' 04 ] || [ $bmajor -gt 2 ]; then
27 - if [ -r /etc/bash_completion ]; then
28 - # Source completion code.
29 - . /etc/bash_completion
30 - fi
31 + _load_completions() {
32 + declare f x loaded_pre=false
33 + for f; do
34 + if [[ -f $f ]]; then
35 + # Prevent loading base twice, initially and via glob
36 + if $loaded_pre && [[ $f == */base ]]; then
37 + continue
38 + fi
39 +
40 + # Some modules, including base, depend on the definitions
41 + # in .pre. See the ebuild for how this is created.
42 + if ! $loaded_pre; then
43 + if [[ ${BASH_COMPLETION-unset} == unset ]]; then
44 + BASH_COMPLETION=/usr/share/bash-completion/base
45 + fi
46 + source /usr/share/bash-completion/.pre
47 + loaded_pre=true
48 + fi
49 +
50 + source "$f"
51 + fi
52 + done
53 +
54 + # Clean up
55 + $loaded_pre && source /usr/share/bash-completion/.post
56 + unset -f _load_completions # not designed to be called more than once
57 + }
58 +
59 + # 1. Load base, if eselected. This was previously known as
60 + # /etc/bash_completion
61 + # 2. Load completion modules, maintained via eselect bashcomp --global
62 + # 3. Load user completion modules, maintained via eselect bashcomp
63 + # 4. Load user completion file last, overrides modules at user discretion
64 + # This order is subject to change once upstream decides on something.
65 + _load_completions \
66 + /etc/bash_completion.d/base \
67 + ~/.bash_completion.d/base \
68 + /etc/bash_completion.d/* \
69 + ~/.bash_completion.d/* \
70 + ~/.bash_completion
71 fi
72 +
73 unset bash bminor bmajor