Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-apps/portage/files/, sys-apps/portage/
Date: Tue, 03 May 2016 15:33:21
Message-Id: 1462289587.4fcd3c6826ab0f73d202305307d9c9d80a85fe05.haubi@gentoo
1 commit: 4fcd3c6826ab0f73d202305307d9c9d80a85fe05
2 Author: Michael Haubenwallner <michael.haubenwallner <AT> ssi-schaefer <DOT> com>
3 AuthorDate: Tue May 3 15:31:35 2016 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Tue May 3 15:33:07 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=4fcd3c68
7
8 +portage-2.2.28-r3: bump ebuildshell patch bug#155161 comment#34
9
10 Package-Manager: portage-2.2.28-prefix
11
12 .../portage/files/portage-2.2.28-ebuildshell.patch | 113 +++++++++++----------
13 ...e-2.2.28-r2.ebuild => portage-2.2.28-r3.ebuild} | 0
14 2 files changed, 60 insertions(+), 53 deletions(-)
15
16 diff --git a/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch b/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch
17 index afd2f39..69373f6 100644
18 --- a/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch
19 +++ b/sys-apps/portage/files/portage-2.2.28-ebuildshell.patch
20 @@ -1,19 +1,19 @@
21 -From c93cb045630db71f8fbc0e0b67960a28764a6852 Mon Sep 17 00:00:00 2001
22 +From 3ae829681363c032c9863d4e5a41a762af89f93e Mon Sep 17 00:00:00 2001
23 From: Michael Haubenwallner <michael.haubenwallner@×××××××.at>
24 Date: Wed, 6 Nov 2013 12:40:05 +0100
25 Subject: [PATCH] Add ebuildshell feature, bug#155161.
26
27 ---
28 - bin/ebuild.sh | 131 ++++++++++++++++++++++++++++++++++-
29 - bin/filter-bash-environment.py | 50 ++++++++-----
30 + bin/ebuild.sh | 123 ++++++++++++++++++++++++++++++++++-
31 + bin/filter-bash-environment.py | 57 +++++++++++-----
32 bin/save-ebuild-env.sh | 2 +-
33 man/make.conf.5 | 6 ++
34 pym/_emerge/AbstractEbuildProcess.py | 1 +
35 pym/portage/const.py | 1 +
36 - 6 files changed, 173 insertions(+), 18 deletions(-)
37 + 6 files changed, 172 insertions(+), 18 deletions(-)
38
39 diff --git a/bin/ebuild.sh b/bin/ebuild.sh
40 -index f1586b2..cb487c0 100755
41 +index f1586b2..8231a98 100755
42 --- a/bin/ebuild.sh
43 +++ b/bin/ebuild.sh
44 @@ -130,7 +130,7 @@ __qa_source() {
45 @@ -25,7 +25,7 @@ index f1586b2..cb487c0 100755
46 retval=$?
47 set +e
48 [[ $shopts != $(shopt) ]] &&
49 -@@ -537,6 +537,135 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
50 +@@ -537,6 +537,127 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
51 unset BIN_PATH BIN BODY FUNC_SRC
52 fi
53
54 @@ -39,8 +39,8 @@ index f1586b2..cb487c0 100755
55 + local __ebuildshell_bash_i_vars="__ebuildshell_.*
56 + _ BASH_ARGC BASH_ARGV BASH_COMMAND BASH_LINENO BASH_SOURCE
57 + BASH_VERSINFO BASH_SUBSHELL BASHOPTS BASHPID COMP_WORDBREAKS
58 -+ DIRSTACK EUID FUNCNAME GROUPS HISTCMD HISTFILE LINENO
59 -+ PIPESTATUS PPID PWD RANDOM SECONDS SHELLOPTS UID"
60 ++ DIRSTACK EUID FUNCNAME GROUPS HISTCMD HISTFILE LINENO PIPESTATUS
61 ++ PPID PS1 PS2 PS3 PS4 PWD RANDOM SECONDS SHELLOPTS UID"
62 + # Allow recursive ebuildshell, for use in multibuild.eclass and similar:
63 + local __ebuildshell_pid=${BASHPID:-$(__bashpid)}
64 + local __ebuildshell_tmpf="${T}/ebuildshell.${__ebuildshell_pid}"
65 @@ -76,56 +76,50 @@ index f1586b2..cb487c0 100755
66 + echo "or use: \"\\\$@\""
67 + # use bash history, but not the 'user's real one
68 + HISTFILE=~/.bash_history
69 -+ # for copy&paste function body lines containing: !
70 ++ # but do not use history-expansion with '!',
71 ++ # for copy&paste of function body lines containing: !
72 + set +H
73 -+ # Support the 'local' keyword outside any shell function
74 -+ # for copy&paste of function body lines: Remember these
75 -+ # "local" variable names for filtering from return-env.
76 -+ __ebuildshell_local_vars=
77 -+ __ebuildshell_local() {
78 -+ local __ebuildshell_local_attr=
79 -+ while [[ \${1} == -* ]]; do
80 -+ __ebuildshell_local_attr+=" \${1}"
81 -+ shift
82 -+ done
83 -+ __ebuildshell_local_vars+=" \${1%%=*} "
84 -+ # Need to declare into the global shell namespace,
85 -+ # as we are in some shell function here apparently.
86 -+ declare -g \${__ebuildshell_local_attr} "\$@"
87 -+ }
88 -+ # within some function, BASH_LINENO is set, and we use real 'local'
89 -+ alias local='\$( (( \${#BASH_LINENO} > 0 )) && echo local || echo __ebuildshell_local)'
90 ++ # For copy&paste of function body lines, we want the 'local'
91 ++ # keyword available at the shell prompt as well. So we alias
92 ++ # the 'local' keyword to 'declare -t', to identify local
93 ++ # variables by their trace attribute.
94 ++ alias local='declare -t'
95 ++ shopt -s expand_aliases
96 ++ # this is a debugging shell already
97 ++ shopt -u extdebug
98 ++ trap - DEBUG
99 + # at exit, dump the current environment
100 + trap "
101 + unalias local
102 -+ unset -f __ebuildshell_local
103 ++ unset -f __call-ebuildshell
104 + rm -f '${__ebuildshell_tmpf}.return-'*
105 + (
106 + (
107 ++ # declare -p does not tell the -g flag,
108 ++ # so we add it by aliasing declare.
109 ++ echo \"alias declare='declare -g'\"
110 + declare -p
111 ++ echo \"unalias declare\"
112 + declare -fp
113 -+ shopt -p | grep -v 'extdebug$'
114 ++ shopt -p | grep -v '\\(expand_aliases\\|extdebug\\)$'
115 + $([[ ${BASH_VERSINFO[0]} == 3 ]] && echo export)
116 + ) |
117 + (
118 -+ # We may have more readonly variables now, but we
119 ++ # We may have more readonly variables now, yet we
120 + # need to filter variables that are readonly already.
121 + 2>'${__ebuildshell_tmpf}.return-rovars' \\
122 + '${PORTAGE_PYTHON:-/tools/haubi/gentoo/s01en24/usr/bin/python}' \\
123 + '${PORTAGE_BIN_PATH}'/filter-bash-environment.py \\
124 + --report-readonly-variables \\
125 + --preserve-readonly-attribute \\
126 -+ '${__ebuildshell_bash_i_vars}
127 -+ ${__ebuildshell_ro_ebuild_vars}
128 -+ '\" \${__ebuildshell_local_vars}\" \\
129 ++ --filter-traced-variables \\
130 ++ '${__ebuildshell_bash_i_vars} \
131 ++ ${__ebuildshell_ro_ebuild_vars}' \\
132 + || die 'filter-bash-environment.py failed'
133 + )
134 + ) > '${__ebuildshell_tmpf}.return-env'
135 + " EXIT
136 -+ # this is a debugging shell already
137 -+ shopt -u extdebug
138 -+ trap - DEBUG
139 -+ # can do some cleanup already
140 ++ # can do some cleanup right now
141 + rm -f '${__ebuildshell_tmpf}.ebuild-'*
142 + EOE
143 + ) > "${__ebuildshell_tmpf}.ebuild-env"
144 @@ -139,16 +133,14 @@ index f1586b2..cb487c0 100755
145 + # prompt is expected to be identical as without the ebuildshell prompt.
146 + local __ebuildshell_status=$?
147 +
148 -+ # Defining a variable without using the the local keyword makes this
149 -+ # variable visible to the 'global' shell namespace. But 'declare -p'
150 -+ # does not show the -g flag, so we need to add that one for all
151 -+ # variables that have been visible to the EXIT trap above.
152 -+ local __ebuildshell_orig_expand_aliases=$(shopt -p expand_aliases)
153 -+ alias declare='declare -g'
154 -+ shopt -s expand_aliases
155 ++ # We might be in a recursive ebuildshell, but do not want
156 ++ # any aliases being active while sourcing the return-env.
157 ++ local __ebuildshell_orig_aliases=$(alias)
158 ++ unalias -a
159 + source "${__ebuildshell_tmpf}.return-env"
160 -+ unalias declare
161 -+ ${__ebuildshell_orig_expand_aliases}
162 ++ unalias -a
163 ++ eval "${__ebuildshell_orig_aliases}"
164 ++
165 + # Portage does whitelist readonly variables. If an ebuild defines
166 + # more readonly variables, their readonly attribute is removed.
167 + # If we ever want to preserve additional readonly variables across
168 @@ -162,19 +154,20 @@ index f1586b2..cb487c0 100755
169 export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
170 trap 'exit 1' SIGTERM
171 diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
172 -index a4cdc54..5ed2584 100755
173 +index a4cdc54..1c4ad58 100755
174 --- a/bin/filter-bash-environment.py
175 +++ b/bin/filter-bash-environment.py
176 -@@ -14,7 +14,7 @@ func_end_re = re.compile(r'^\}$')
177 +@@ -14,7 +14,8 @@ func_end_re = re.compile(r'^\}$')
178
179 var_assign_re = re.compile(r'(^|^declare\s+-\S+\s+|^declare\s+|^export\s+)([^=\s]+)=("|\')?.*$')
180 close_quote_re = re.compile(r'(\\"|"|\')\s*$')
181 -readonly_re = re.compile(r'^declare\s+-(\S*)r(\S*)\s+')
182 +readonly_re = re.compile(r'^declare\s+-(\S*)r(\S*)\s+([^=\s]+)')
183 ++trace_re = re.compile(r'^declare\s+-\S*t\S*\s+')
184 # declare without assignment
185 var_declare_re = re.compile(r'^declare(\s+-\S+)?\s+([^=\s]+)\s*$')
186
187 -@@ -29,7 +29,7 @@ def have_end_quote(quote, line):
188 +@@ -29,7 +30,7 @@ def have_end_quote(quote, line):
189 return close_quote_match is not None and \
190 close_quote_match.group(1) == quote
191
192 @@ -183,7 +176,7 @@ index a4cdc54..5ed2584 100755
193 readonly_match = readonly_re.match(line)
194 if readonly_match is not None:
195 declare_opts = ''
196 -@@ -37,14 +37,19 @@ def filter_declare_readonly_opt(line):
197 +@@ -37,14 +38,19 @@ def filter_declare_readonly_opt(line):
198 group = readonly_match.group(i)
199 if group is not None:
200 declare_opts += group
201 @@ -207,7 +200,16 @@ index a4cdc54..5ed2584 100755
202 # Filter out any instances of the \1 character from variable values
203 # since this character multiplies each time that the environment
204 # is saved (strange bash behavior). This can eventually result in
205 -@@ -77,7 +82,7 @@ def filter_bash_environment(pattern, file_in, file_out):
206 +@@ -68,6 +74,8 @@ def filter_bash_environment(pattern, file_in, file_out):
207 + quote = var_assign_match.group(3)
208 + filter_this = pattern.match(var_assign_match.group(2)) \
209 + is not None
210 ++ if not filter_this and '--filter-traced-variables' in options:
211 ++ filter_this = trace_re.match(line) is not None
212 + # Exclude the start quote when searching for the end quote,
213 + # to ensure that the start quote is not misidentified as the
214 + # end quote (happens if there is a newline immediately after
215 +@@ -77,7 +85,7 @@ def filter_bash_environment(pattern, file_in, file_out):
216 multi_line_quote = quote
217 multi_line_quote_filter = filter_this
218 if not filter_this:
219 @@ -216,16 +218,19 @@ index a4cdc54..5ed2584 100755
220 file_out.write(line.replace("\1", ""))
221 continue
222 else:
223 -@@ -87,7 +92,7 @@ def filter_bash_environment(pattern, file_in, file_out):
224 +@@ -86,8 +94,10 @@ def filter_bash_environment(pattern, file_in, file_out):
225 + # declare without assignment
226 filter_this = pattern.match(declare_match.group(2)) \
227 is not None
228 ++ if not filter_this and '--filter-traced-variables' in options:
229 ++ filter_this = trace_re.match(line) is not None
230 if not filter_this:
231 - line = filter_declare_readonly_opt(line)
232 + line = filter_declare_readonly_opt(line, options)
233 file_out.write(line)
234 continue
235
236 -@@ -124,13 +129,26 @@ if __name__ == "__main__":
237 +@@ -124,13 +134,28 @@ if __name__ == "__main__":
238 "while leaving bash function definitions and here-documents " + \
239 "intact. The PATTERN is a space separated list of variable names" + \
240 " and it supports python regular expression syntax."
241 @@ -243,6 +248,8 @@ index a4cdc54..5ed2584 100755
242 + "Write names of readonly variables to stderr.",
243 + '--preserve-readonly-attribute':
244 + "Preserve the '-r' flag in 'declare -r'.",
245 ++ '--filter-traced-variables':
246 ++ "Filter out variables declared with '-t' attribute."
247 + }
248 + options = {}
249 + for arg in sys.argv[1:]:
250 @@ -259,7 +266,7 @@ index a4cdc54..5ed2584 100755
251
252 if len(args) != 1:
253 sys.stderr.write(usage + "\n")
254 -@@ -154,5 +172,5 @@ if __name__ == "__main__":
255 +@@ -154,5 +179,5 @@ if __name__ == "__main__":
256
257 var_pattern = "^(%s)$" % "|".join(var_pattern)
258 filter_bash_environment(
259
260 diff --git a/sys-apps/portage/portage-2.2.28-r2.ebuild b/sys-apps/portage/portage-2.2.28-r3.ebuild
261 similarity index 100%
262 rename from sys-apps/portage/portage-2.2.28-r2.ebuild
263 rename to sys-apps/portage/portage-2.2.28-r3.ebuild