1 |
vapier 15/02/24 20:58:46 |
2 |
|
3 |
Added: bash-4.3-declare-visibility.patch bashrc-r2 |
4 |
Log: |
5 |
Do window title setup through PS1 #223641 by michael@××××××××.com. Add history -a to PROMPT_COMMAND #517342 by Paweł Hajdan, Jr.. Add fix from upstream for variable declare weirdness. |
6 |
|
7 |
(Portage version: 2.2.17/cvs/Linux x86_64, signed Manifest commit with key D2E96200) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-shells/bash/files/bash-4.3-declare-visibility.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/files/bash-4.3-declare-visibility.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/files/bash-4.3-declare-visibility.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: bash-4.3-declare-visibility.patch |
16 |
=================================================================== |
17 |
http://lists.gnu.org/archive/html/bug-bash/2015-02/msg00075.html |
18 |
|
19 |
assign_array_var_from_word_list: after assignment, mark variable as no |
20 |
longer invisible |
21 |
|
22 |
assign_array_var_from_string: after assignment, mark variable as no |
23 |
longer invisible |
24 |
|
25 |
diff --git a/arrayfunc.c b/arrayfunc.c |
26 |
index c2ea0e5..6dab71c 100644 |
27 |
--- a/arrayfunc.c |
28 |
+++ b/arrayfunc.c |
29 |
@@ -407,6 +407,9 @@ assign_array_var_from_word_list (var, list, flags) |
30 |
(*var->assign_func) (var, l->word->word, i, 0); |
31 |
else |
32 |
array_insert (a, i, l->word->word); |
33 |
+ |
34 |
+ VUNSETATTR (var, att_invisible); /* no longer invisible */ |
35 |
+ |
36 |
return var; |
37 |
} |
38 |
|
39 |
@@ -639,6 +642,10 @@ assign_array_var_from_string (var, value, flags) |
40 |
|
41 |
if (nlist) |
42 |
dispose_words (nlist); |
43 |
+ |
44 |
+ if (var) |
45 |
+ VUNSETATTR (var, att_invisible); /* no longer invisible */ |
46 |
+ |
47 |
return (var); |
48 |
} |
49 |
|
50 |
|
51 |
bind_int_variable: make sure `v' is non-null before making it visible |
52 |
|
53 |
diff --git a/variables.c b/variables.c |
54 |
index 2f07ebb..cbe7806 100644 |
55 |
--- a/variables.c |
56 |
+++ b/variables.c |
57 |
@@ -2872,10 +2872,12 @@ bind_int_variable (lhs, rhs) |
58 |
#endif |
59 |
v = bind_variable (lhs, rhs, 0); |
60 |
|
61 |
- if (v && isint) |
62 |
- VSETATTR (v, att_integer); |
63 |
- |
64 |
- VUNSETATTR (v, att_invisible); |
65 |
+ if (v) |
66 |
+ { |
67 |
+ if (isint) |
68 |
+ VSETATTR (v, att_integer); |
69 |
+ VUNSETATTR (v, att_invisible); |
70 |
+ } |
71 |
|
72 |
return (v); |
73 |
} |
74 |
-- |
75 |
2.3.0 |
76 |
|
77 |
|
78 |
|
79 |
|
80 |
1.1 app-shells/bash/files/bashrc-r2 |
81 |
|
82 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/files/bashrc-r2?rev=1.1&view=markup |
83 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-shells/bash/files/bashrc-r2?rev=1.1&content-type=text/plain |
84 |
|
85 |
Index: bashrc-r2 |
86 |
=================================================================== |
87 |
# /etc/bash/bashrc |
88 |
# |
89 |
# This file is sourced by all *interactive* bash shells on startup, |
90 |
# including some apparently interactive shells such as scp and rcp |
91 |
# that can't tolerate any output. So make sure this doesn't display |
92 |
# anything or bad things will happen ! |
93 |
|
94 |
|
95 |
# Test for an interactive shell. There is no need to set anything |
96 |
# past this point for scp and rcp, and it's important to refrain from |
97 |
# outputting anything in those cases. |
98 |
if [[ $- != *i* ]] ; then |
99 |
# Shell is non-interactive. Be done now! |
100 |
return |
101 |
fi |
102 |
|
103 |
# Bash won't get SIGWINCH if another process is in the foreground. |
104 |
# Enable checkwinsize so that bash will check the terminal size when |
105 |
# it regains control. #65623 |
106 |
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) |
107 |
shopt -s checkwinsize |
108 |
|
109 |
# Disable completion when the input buffer is empty. i.e. Hitting tab |
110 |
# and waiting a long time for bash to expand all of $PATH. |
111 |
shopt -s no_empty_cmd_completion |
112 |
|
113 |
# Enable history appending instead of overwriting when exiting. #139609 |
114 |
shopt -s histappend |
115 |
|
116 |
# Save each command to the history file as it's executed. #517342 |
117 |
# This does mean sessions get interleaved when reading later on, but this |
118 |
# way the history is always up to date. History is not synced across live |
119 |
# sessions though; that is what `history -n` does. |
120 |
PROMPT_COMMAND='history -a' |
121 |
|
122 |
# Change the window title of X terminals |
123 |
case ${TERM} in |
124 |
xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*) |
125 |
PS1='\[\033]0;\u@\h:\w\007\]' |
126 |
;; |
127 |
screen*) |
128 |
PS1='\[\033k\u@\h:\w\033\\\]' |
129 |
;; |
130 |
*) |
131 |
unset PS1 |
132 |
;; |
133 |
esac |
134 |
|
135 |
use_color=false |
136 |
#BSD#@# BSD doesn't typically come with dircolors so we need |
137 |
#BSD#@# to hardcode some terminals in here. |
138 |
#BSD#@case ${TERM} in |
139 |
#BSD#@ xterm*|rxvt*|Eterm|aterm|kterm|gnome*|screen|cons25) use_color=true;; |
140 |
#BSD#@esac |
141 |
|
142 |
# Set colorful PS1 only on colorful terminals. |
143 |
# dircolors --print-database uses its own built-in database |
144 |
# instead of using /etc/DIR_COLORS. Try to use the external file |
145 |
# first to take advantage of user additions. Use internal bash |
146 |
# globbing instead of external grep binary. |
147 |
safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM |
148 |
match_lhs="" |
149 |
[[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)" |
150 |
[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)" |
151 |
[[ -z ${match_lhs} ]] \ |
152 |
&& type -P dircolors >/dev/null \ |
153 |
&& match_lhs=$(dircolors --print-database) |
154 |
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true |
155 |
|
156 |
if ${use_color} ; then |
157 |
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489 |
158 |
if type -P dircolors >/dev/null ; then |
159 |
if [[ -f ~/.dir_colors ]] ; then |
160 |
eval $(dircolors -b ~/.dir_colors) |
161 |
elif [[ -f /etc/DIR_COLORS ]] ; then |
162 |
eval $(dircolors -b /etc/DIR_COLORS) |
163 |
fi |
164 |
fi |
165 |
|
166 |
if [[ ${EUID} == 0 ]] ; then |
167 |
PS1+='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] ' |
168 |
else |
169 |
PS1+='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ' |
170 |
fi |
171 |
|
172 |
#BSD#@export CLICOLOR=1 |
173 |
#GNU#@alias ls='ls --color=auto' |
174 |
alias grep='grep --colour=auto' |
175 |
alias egrep='egrep --colour=auto' |
176 |
alias fgrep='fgrep --colour=auto' |
177 |
else |
178 |
if [[ ${EUID} == 0 ]] ; then |
179 |
# show root@ when we don't have colors |
180 |
PS1+='\u@\h \W \$ ' |
181 |
else |
182 |
PS1+='\u@\h \w \$ ' |
183 |
fi |
184 |
fi |
185 |
|
186 |
for sh in /etc/bash/bashrc.d/* ; do |
187 |
[[ -r ${sh} ]] && source "${sh}" |
188 |
done |
189 |
|
190 |
# Try to keep environment pollution down, EPA loves us. |
191 |
unset use_color safe_term match_lhs sh |