Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@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: Sun, 02 Aug 2020 11:43:35
Message-Id: 1596368586.e4209bd2ca1ed72324cac02cd49a0634114c5f10.grobian@gentoo
1 commit: e4209bd2ca1ed72324cac02cd49a0634114c5f10
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 2 11:43:06 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 2 11:43:06 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=e4209bd2
7
8 sys-apps/portage: cleanup and version bump 3.0.1
9
10 Package-Manager: Portage-3.0.1-prefix, Repoman-2.3.23
11 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
12
13 sys-apps/portage/Manifest | 3 +-
14 sys-apps/portage/files/05portage.envd | 1 -
15 sys-apps/portage/files/portage-2.2.28-cygwin.patch | 16 -
16 .../files/portage-2.2.28-ebuildshell-r1.patch | 354 --------------------
17 .../portage/files/portage-2.3.10-ebuildshell.patch | 355 ---------------------
18 .../portage/files/portage-2.3.40-ebuildshell.patch | 354 --------------------
19 sys-apps/portage/files/portage-ccache.conf | 2 +
20 sys-apps/portage/metadata.xml | 1 -
21 sys-apps/portage/portage-2.3.100.ebuild | 264 ---------------
22 sys-apps/portage/portage-2.3.68.ebuild | 264 ---------------
23 ...{portage-2.3.84.ebuild => portage-3.0.1.ebuild} | 117 ++++---
24 11 files changed, 79 insertions(+), 1652 deletions(-)
25
26 diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest
27 index 7e8f3291c5..40b9f12b82 100644
28 --- a/sys-apps/portage/Manifest
29 +++ b/sys-apps/portage/Manifest
30 @@ -1,3 +1,2 @@
31 DIST prefix-portage-2.3.100.tar.bz2 1331695 BLAKE2B 165f113041da8ad1150cc59d25a420effaa163a7694ba8ff36ce1e5fa75669b8fde31ad74594b28b987f9ec5685b9a31aa5228419afd476726ba17ec8f7575db SHA512 8163bfd4e83e48d560dd07150dd468d3b4a63d1507d23226107479bd5de9da3cd94308851b64c63851572288877cb2774f986f8c1a5163521a341ce4c72fbf0c
32 -DIST prefix-portage-2.3.68.tar.bz2 1283044 BLAKE2B 81a9462c2b34b64baff78bc046676abf147a6840f7fb2872c9e26eef5a110e2c53b550ac213f734f7c4e70e4b220ea62d885cd99652d9093448f6e5c4633a115 SHA512 7c6124e0b01fd1fdba68a5cb68882baa2301945faf559bb61afd6b632128ca435d7e9a596b1079bd744ed4155041399ba0a3779190c9fa891b5dc815ccb46813
33 -DIST prefix-portage-2.3.84.tar.bz2 1289922 BLAKE2B 1644b7c1a03b7fbccabe24bfd9c8378d12aeabeda2db35e286372901898d5f572c39e36625fbc2914334ca64e38e1320adca0143a9898fca64223be7d8a877cc SHA512 e243e21405a53e6ff234a7851fc4ef869450dc213acd6ed2168329c7c947289a97c60104aa31bd85319b3fef0abbc2c5759608abd795edc426b06ddea2ce3cdb
34 +DIST prefix-portage-3.0.1.tar.bz2 1279330 BLAKE2B ac94a2c2b56f23cf35cb229ae8719077e41fe7fb8e74d16beb3542b43d246d6c26dce73b9cec4c126b65b9bf0b4452bc233a83aeb4c873e8dd7c8d5742008221 SHA512 5c141b80e20f11aad6990e5f42fcc2cddb6475e03fc978fd1446773dd6833dd4ccf96b07440e1184cb95e210654218011b383872004907a915164813da22663c
35
36 diff --git a/sys-apps/portage/files/05portage.envd b/sys-apps/portage/files/05portage.envd
37 deleted file mode 100644
38 index ec949055ca..0000000000
39 --- a/sys-apps/portage/files/05portage.envd
40 +++ /dev/null
41 @@ -1 +0,0 @@
42 -PYTHONPATH="@GENTOO_PORTAGE_EPREFIX@/usr/lib/portage/pym"
43
44 diff --git a/sys-apps/portage/files/portage-2.2.28-cygwin.patch b/sys-apps/portage/files/portage-2.2.28-cygwin.patch
45 deleted file mode 100644
46 index 9a9bbec43a..0000000000
47 --- a/sys-apps/portage/files/portage-2.2.28-cygwin.patch
48 +++ /dev/null
49 @@ -1,16 +0,0 @@
50 ---- prefix-portage-2.2.28/bin/helper-functions.sh.orig 2016-11-16 15:43:02.338368826 +0100
51 -+++ prefix-portage-2.2.28/bin/helper-functions.sh 2016-11-16 15:43:21.498359600 +0100
52 -@@ -21,11 +21,12 @@
53 - # Setup a pipe for children to write their pids to when they finish.
54 - # We have to allocate two fd's because POSIX has undefined behavior
55 - # when you open a FIFO for simultaneous read/write. #487056
56 -+ # And Cygwin supports just one read/write fd at once. #583962
57 - local pipe=$(mktemp -t multijob.XXXXXX)
58 - rm -f "${pipe}"
59 - mkfifo -m 600 "${pipe}"
60 -- __redirect_alloc_fd mj_write_fd "${pipe}"
61 - __redirect_alloc_fd mj_read_fd "${pipe}"
62 -+ __redirect_alloc_fd mj_write_fd "${pipe}" '>'
63 - rm -f "${pipe}"
64 -
65 - # See how many children we can fork based on the user's settings.
66
67 diff --git a/sys-apps/portage/files/portage-2.2.28-ebuildshell-r1.patch b/sys-apps/portage/files/portage-2.2.28-ebuildshell-r1.patch
68 deleted file mode 100644
69 index 298f0a0b08..0000000000
70 --- a/sys-apps/portage/files/portage-2.2.28-ebuildshell-r1.patch
71 +++ /dev/null
72 @@ -1,354 +0,0 @@
73 -From bd58cc5f041558ab0885a1bf733319c38a24f24b Mon Sep 17 00:00:00 2001
74 -From: Michael Haubenwallner <michael.haubenwallner@×××××××.at>
75 -Date: Wed, 6 Nov 2013 12:40:05 +0100
76 -Subject: [PATCH] Add the ebuildshell feature, bug#155161.
77 -
78 ----
79 - bin/ebuild.sh | 145 ++++++++++++++++++++++++++++++++++-
80 - bin/filter-bash-environment.py | 57 ++++++++++----
81 - bin/save-ebuild-env.sh | 2 +-
82 - man/make.conf.5 | 6 ++
83 - pym/_emerge/AbstractEbuildProcess.py | 1 +
84 - pym/portage/const.py | 1 +
85 - 6 files changed, 194 insertions(+), 18 deletions(-)
86 -
87 -diff --git a/bin/ebuild.sh b/bin/ebuild.sh
88 -index a400ef7..b5a4eaa 100755
89 ---- a/bin/ebuild.sh
90 -+++ b/bin/ebuild.sh
91 -@@ -112,7 +112,7 @@ __qa_source() {
92 - __qa_call() {
93 - local shopts=$(shopt) OLDIFS="$IFS"
94 - local retval
95 -- "$@"
96 -+ __call-ebuildshell "$@"
97 - retval=$?
98 - set +e
99 - [[ $shopts != $(shopt) ]] &&
100 -@@ -524,6 +524,149 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
101 - unset BIN_PATH BIN BODY FUNC_SRC
102 - fi
103 -
104 -+__call-ebuildshell() {
105 -+ if ! has ebuildshell ${FEATURES}; then
106 -+ "$@"
107 -+ return $?
108 -+ fi
109 -+ local __ebuildshell_args=( "$@" )
110 -+ # These are the variables I have seen 'bash -i' maintaining the values for:
111 -+ local __ebuildshell_bash_i_vars="__ebuildshell_.*
112 -+ _ BASH_ARGC BASH_ARGV BASH_COMMAND BASH_LINENO BASH_SOURCE
113 -+ BASH_VERSINFO BASH_SUBSHELL BASHOPTS BASHPID COMP_WORDBREAKS
114 -+ DIRSTACK EUID FUNCNAME GROUPS HISTCMD HISTFILE LINENO PIPESTATUS
115 -+ PPID PS1 PS2 PS3 PS4 PWD RANDOM SECONDS SHELLOPTS UID"
116 -+ # Allow recursive ebuildshell, for use in multibuild.eclass and similar:
117 -+ local __ebuildshell_pid=${BASHPID:-$(__bashpid)}
118 -+ local __ebuildshell_tmpf="${T}/ebuildshell.${__ebuildshell_pid}"
119 -+ rm -f "${__ebuildshell_tmpf}."{ebuild,return}-{env,rovars}
120 -+ (
121 -+ cat <<-EOE
122 -+ # local variables of functions using recursive ebuildshell are
123 -+ # visible to the EXIT trap of that recursive ebuildshell. To
124 -+ # keep them local, we have to filter them from that recursive
125 -+ # ebuildshell's return-env. As 'declare -p' is unable to tell
126 -+ # local-ity of variables, we abuse the trace attribute for local
127 -+ # variables to filter them from the return-env. So we need the
128 -+ # local alias active before declaring any functions.
129 -+ # On a sidehand, this allows for copy&paste of function body
130 -+ # lines including the local keyword.
131 -+ alias local='declare -t'
132 -+ shopt -s expand_aliases
133 -+ EOE
134 -+ (
135 -+ declare -p
136 -+ declare -fp
137 -+ shopt -p
138 -+ [[ ${BASH_VERSINFO[0]} == 3 ]] && export
139 -+ ) |
140 -+ (
141 -+ # we need everything but the bash vars after 'env -i'
142 -+ 2>"${__ebuildshell_tmpf}.ebuild-rovars" \
143 -+ "${PORTAGE_PYTHON:-/tools/haubi/gentoo/s01en24/usr/bin/python}" \
144 -+ "${PORTAGE_BIN_PATH}"/filter-bash-environment.py \
145 -+ --report-readonly-variables \
146 -+ --preserve-readonly-attribute \
147 -+ "${__ebuildshell_bash_i_vars}" \
148 -+ || die "filter-bash-environment.py failed"
149 -+ )
150 -+ # 'declare -g' is available since bash-4.2,
151 -+ # https://bugs.gentoo.org/show_bug.cgi?id=155161#c35
152 -+ if (( ${BASH_VERSINFO[0]} > 4 )) ||
153 -+ (( ${BASH_VERSINFO[0]} == 4 && ${BASH_VERSINFO[1]} >= 2 ))
154 -+ then
155 -+ __ebuildshell_bash42_true=
156 -+ __ebuildshell_bash42_false='#bash-4.2#'
157 -+ else
158 -+ __ebuildshell_bash42_true='#bash-4.2#'
159 -+ __ebuildshell_bash42_false=
160 -+ fi
161 -+ # The already readonly variables, without bash maintained ones:
162 -+ __ebuildshell_ro_ebuild_vars=$(<"${__ebuildshell_tmpf}.ebuild-rovars")
163 -+ cat <<-EOE
164 -+ # properly quote the function arguments
165 -+ $(declare -p __ebuildshell_args)
166 -+ set -- "\${__ebuildshell_args[@]}"
167 -+ unset __ebuildshell_args
168 -+ # be informative about what to do
169 -+ PS1="EBUILD ${PN} $1 \$ "
170 -+ type $1
171 -+ ${__ebuildshell_bash42_false}echo 'warning: preserving variables across phases requires bash-4.2'
172 -+ echo "WANTED: \$@"
173 -+ echo "or use: \"\\\$@\""
174 -+ # use bash history, but not the 'user's real one
175 -+ HISTFILE=~/.bash_history
176 -+ # but do not use history-expansion with '!',
177 -+ # for copy&paste of function body lines containing: !
178 -+ set +H
179 -+ # this is a debugging shell already
180 -+ shopt -u extdebug
181 -+ trap - DEBUG
182 -+ # at exit, dump the current environment
183 -+ trap "
184 -+ unalias local
185 -+ unset -f __call-ebuildshell
186 -+ rm -f '${__ebuildshell_tmpf}.return-'*
187 -+ (
188 -+ (
189 -+ # declare -p does not tell the -g flag,
190 -+ # so we add it by aliasing declare.
191 -+ ${__ebuildshell_bash42_true}echo \"alias declare='declare -g'\"
192 -+ declare -p
193 -+ ${__ebuildshell_bash42_true}echo \"unalias declare\"
194 -+ declare -fp
195 -+ shopt -p | grep -v '\\(expand_aliases\\|extdebug\\)$'
196 -+ $([[ ${BASH_VERSINFO[0]} == 3 ]] && echo export)
197 -+ ) |
198 -+ (
199 -+ # We may have more readonly variables now, yet we
200 -+ # need to filter variables that were readonly before.
201 -+ # And filter local variables by their trace attribute.
202 -+ 2>'${__ebuildshell_tmpf}.return-rovars' \\
203 -+ '${PORTAGE_PYTHON:-/tools/haubi/gentoo/s01en24/usr/bin/python}' \\
204 -+ '${PORTAGE_BIN_PATH}'/filter-bash-environment.py \\
205 -+ --report-readonly-variables \\
206 -+ --preserve-readonly-attribute \\
207 -+ --filter-traced-variables \\
208 -+ '${__ebuildshell_bash_i_vars} \
209 -+ ${__ebuildshell_ro_ebuild_vars}' \\
210 -+ || die 'filter-bash-environment.py failed'
211 -+ )
212 -+ ) > '${__ebuildshell_tmpf}.return-env'
213 -+ " EXIT
214 -+ # can do some cleanup right now
215 -+ rm -f '${__ebuildshell_tmpf}.ebuild-'*
216 -+ EOE
217 -+ ) > "${__ebuildshell_tmpf}.ebuild-env"
218 -+
219 -+ # pre-fill the history with "$@"
220 -+ echo '"$@"' >> ~/.bash_history
221 -+
222 -+ env -i ${BASH} --rcfile "${__ebuildshell_tmpf}.ebuild-env" -i
223 -+
224 -+ # The environment- and exit-status handling after leaving the ebuildshell
225 -+ # prompt is expected to be identical as without the ebuildshell prompt.
226 -+ local __ebuildshell_status=$?
227 -+
228 -+ # We might be in a recursive ebuildshell, but do not want
229 -+ # any aliases being active while sourcing the return-env.
230 -+ local __ebuildshell_orig_aliases=$(alias)
231 -+ unalias -a
232 -+ source "${__ebuildshell_tmpf}.return-env"
233 -+ unalias -a
234 -+ eval "${__ebuildshell_orig_aliases}"
235 -+
236 -+ # Portage has a whitelist of readonly variables: If an ebuild defines
237 -+ # additional readonly variables, their readonly attribute is removed
238 -+ # across ebuild phases. If we ever want to preserve the readonly
239 -+ # attribute of additional ebuild-defined variables across phases,
240 -+ # when returning from the ebuildshell their names are in
241 -+ # "${__ebuildshell_tmpf}.return-rovars"
242 -+ rm -f "${__ebuildshell_tmpf}."{ebuild,return}-{env,rovars}
243 -+
244 -+ return ${__ebuildshell_status}
245 -+}
246 -+
247 - # Subshell/helper die support (must export for the die helper).
248 - export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
249 - trap 'exit 1' SIGTERM
250 -diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
251 -index a4cdc54..1c4ad58 100755
252 ---- a/bin/filter-bash-environment.py
253 -+++ b/bin/filter-bash-environment.py
254 -@@ -14,7 +14,8 @@ func_end_re = re.compile(r'^\}$')
255 -
256 - var_assign_re = re.compile(r'(^|^declare\s+-\S+\s+|^declare\s+|^export\s+)([^=\s]+)=("|\')?.*$')
257 - close_quote_re = re.compile(r'(\\"|"|\')\s*$')
258 --readonly_re = re.compile(r'^declare\s+-(\S*)r(\S*)\s+')
259 -+readonly_re = re.compile(r'^declare\s+-(\S*)r(\S*)\s+([^=\s]+)')
260 -+trace_re = re.compile(r'^declare\s+-\S*t\S*\s+')
261 - # declare without assignment
262 - var_declare_re = re.compile(r'^declare(\s+-\S+)?\s+([^=\s]+)\s*$')
263 -
264 -@@ -29,7 +30,7 @@ def have_end_quote(quote, line):
265 - return close_quote_match is not None and \
266 - close_quote_match.group(1) == quote
267 -
268 --def filter_declare_readonly_opt(line):
269 -+def filter_declare_readonly_opt(line, options):
270 - readonly_match = readonly_re.match(line)
271 - if readonly_match is not None:
272 - declare_opts = ''
273 -@@ -37,14 +38,19 @@ def filter_declare_readonly_opt(line):
274 - group = readonly_match.group(i)
275 - if group is not None:
276 - declare_opts += group
277 -+ var = readonly_match.group(3)
278 -+ if '--report-readonly-variables' in options:
279 -+ sys.stderr.write(var + "\n")
280 -+ if '--preserve-readonly-attribute' in options:
281 -+ declare_opts += 'r'
282 - if declare_opts:
283 -- line = 'declare -%s %s' % \
284 -- (declare_opts, line[readonly_match.end():])
285 -+ line = 'declare -%s %s%s' % \
286 -+ (declare_opts, var, line[readonly_match.end():])
287 - else:
288 -- line = 'declare ' + line[readonly_match.end():]
289 -+ line = 'declare ' + var + line[readonly_match.end():]
290 - return line
291 -
292 --def filter_bash_environment(pattern, file_in, file_out):
293 -+def filter_bash_environment(pattern, file_in, file_out, options):
294 - # Filter out any instances of the \1 character from variable values
295 - # since this character multiplies each time that the environment
296 - # is saved (strange bash behavior). This can eventually result in
297 -@@ -68,6 +74,8 @@ def filter_bash_environment(pattern, file_in, file_out):
298 - quote = var_assign_match.group(3)
299 - filter_this = pattern.match(var_assign_match.group(2)) \
300 - is not None
301 -+ if not filter_this and '--filter-traced-variables' in options:
302 -+ filter_this = trace_re.match(line) is not None
303 - # Exclude the start quote when searching for the end quote,
304 - # to ensure that the start quote is not misidentified as the
305 - # end quote (happens if there is a newline immediately after
306 -@@ -77,7 +85,7 @@ def filter_bash_environment(pattern, file_in, file_out):
307 - multi_line_quote = quote
308 - multi_line_quote_filter = filter_this
309 - if not filter_this:
310 -- line = filter_declare_readonly_opt(line)
311 -+ line = filter_declare_readonly_opt(line, options)
312 - file_out.write(line.replace("\1", ""))
313 - continue
314 - else:
315 -@@ -86,8 +94,10 @@ def filter_bash_environment(pattern, file_in, file_out):
316 - # declare without assignment
317 - filter_this = pattern.match(declare_match.group(2)) \
318 - is not None
319 -+ if not filter_this and '--filter-traced-variables' in options:
320 -+ filter_this = trace_re.match(line) is not None
321 - if not filter_this:
322 -- line = filter_declare_readonly_opt(line)
323 -+ line = filter_declare_readonly_opt(line, options)
324 - file_out.write(line)
325 - continue
326 -
327 -@@ -124,13 +134,28 @@ if __name__ == "__main__":
328 - "while leaving bash function definitions and here-documents " + \
329 - "intact. The PATTERN is a space separated list of variable names" + \
330 - " and it supports python regular expression syntax."
331 -- usage = "usage: %s PATTERN" % os.path.basename(sys.argv[0])
332 -- args = sys.argv[1:]
333 --
334 -- if '-h' in args or '--help' in args:
335 -- sys.stdout.write(usage + "\n")
336 -- sys.stdout.flush()
337 -- sys.exit(os.EX_OK)
338 -+ usage = "usage: %s [-h|<options>] PATTERN" % os.path.basename(sys.argv[0])
339 -+ args = []
340 -+ known_options = {
341 -+ '--report-readonly-variables':
342 -+ "Write names of readonly variables to stderr.",
343 -+ '--preserve-readonly-attribute':
344 -+ "Preserve the '-r' flag in 'declare -r'.",
345 -+ '--filter-traced-variables':
346 -+ "Filter out variables declared with '-t' attribute."
347 -+ }
348 -+ options = {}
349 -+ for arg in sys.argv[1:]:
350 -+ if arg in known_options.keys():
351 -+ options[arg] = True
352 -+ continue
353 -+ if '-h' == arg or '--help' == arg:
354 -+ sys.stdout.write(usage + "\n\nKnown <options>:\n\n")
355 -+ for option, descr in known_options.items():
356 -+ sys.stdout.write(" " + option + "\t" + descr + "\n")
357 -+ sys.stdout.flush()
358 -+ sys.exit(os.EX_OK)
359 -+ args.append(arg)
360 -
361 - if len(args) != 1:
362 - sys.stderr.write(usage + "\n")
363 -@@ -154,5 +179,5 @@ if __name__ == "__main__":
364 -
365 - var_pattern = "^(%s)$" % "|".join(var_pattern)
366 - filter_bash_environment(
367 -- re.compile(var_pattern), file_in, file_out)
368 -+ re.compile(var_pattern), file_in, file_out, options)
369 - file_out.flush()
370 -diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
371 -index f0bf001..706660d 100644
372 ---- a/bin/save-ebuild-env.sh
373 -+++ b/bin/save-ebuild-env.sh
374 -@@ -53,7 +53,7 @@ __save_ebuild_env() {
375 - einfo einfon ewarn eerror ebegin __eend eend KV_major \
376 - KV_minor KV_micro KV_to_int get_KV has \
377 - __has_phase_defined_up_to \
378 -- hasv hasq __qa_source __qa_call \
379 -+ hasv hasq __qa_source __qa_call __call-ebuildshell \
380 - addread addwrite adddeny addpredict __sb_append_var \
381 - use usev useq has_version portageq \
382 - best_version use_with use_enable register_die_hook \
383 -diff --git a/man/make.conf.5 b/man/make.conf.5
384 -index aea189e..46b0aa4 100644
385 ---- a/man/make.conf.5
386 -+++ b/man/make.conf.5
387 -@@ -380,6 +380,12 @@ exist). Also see the related \fIunmerge\-backup\fR feature.
388 - Use locks to ensure that unsandboxed ebuild phases never execute
389 - concurrently. Also see \fIparallel\-install\fR.
390 - .TP
391 -+.B ebuildshell
392 -+Drop into an interactive shell for each phase function, meant for
393 -+debugging. Because the shell would normally be used to execute the
394 -+phase function, commands like src_unpack or epatch are available in the
395 -+interactive shell. Use `die` to terminate the merge.
396 -+.TP
397 - .B fail\-clean
398 - Clean up temporary files after a build failure. This is particularly useful
399 - if you have \fBPORTAGE_TMPDIR\fR on tmpfs. If this feature is enabled, you
400 -diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
401 -index 8bd30a6..4ff78b4 100644
402 ---- a/pym/_emerge/AbstractEbuildProcess.py
403 -+++ b/pym/_emerge/AbstractEbuildProcess.py
404 -@@ -161,6 +161,7 @@ class AbstractEbuildProcess(SpawnProcess):
405 - self.fd_pipes = {}
406 - null_fd = None
407 - if 0 not in self.fd_pipes and \
408 -+ "ebuildshell" not in self.settings.features and \
409 - self.phase not in self._phases_interactive_whitelist and \
410 - "interactive" not in self.settings.get("PROPERTIES", "").split():
411 - null_fd = os.open('/dev/null', os.O_RDONLY)
412 -diff --git a/pym/portage/const.py b/pym/portage/const.py
413 -index 179efce..0a91aaf 100644
414 ---- a/pym/portage/const.py
415 -+++ b/pym/portage/const.py
416 -@@ -142,6 +142,7 @@ SUPPORTED_FEATURES = frozenset([
417 - "distlocks",
418 - "downgrade-backup",
419 - "ebuild-locks",
420 -+ "ebuildshell",
421 - "fail-clean",
422 - "fakeroot",
423 - "fixlafiles",
424 ---
425 -2.10.2
426 -
427
428 diff --git a/sys-apps/portage/files/portage-2.3.10-ebuildshell.patch b/sys-apps/portage/files/portage-2.3.10-ebuildshell.patch
429 deleted file mode 100644
430 index d0381a0696..0000000000
431 --- a/sys-apps/portage/files/portage-2.3.10-ebuildshell.patch
432 +++ /dev/null
433 @@ -1,355 +0,0 @@
434 -From 05a16e4c910f7dc053358d8519c6708d3a4b14ca Mon Sep 17 00:00:00 2001
435 -From: Michael Haubenwallner <michael.haubenwallner@×××××××.at>
436 -Date: Wed, 6 Nov 2013 12:40:05 +0100
437 -Subject: [PATCH] Add ebuildshell feature, bug#155161.
438 -
439 ----
440 - bin/ebuild.sh | 146 ++++++++++++++++++++++++++++++++++-
441 - bin/filter-bash-environment.py | 57 ++++++++++----
442 - bin/save-ebuild-env.sh | 2 +-
443 - man/make.conf.5 | 6 ++
444 - pym/_emerge/AbstractEbuildProcess.py | 1 +
445 - pym/portage/const.py | 1 +
446 - 6 files changed, 195 insertions(+), 18 deletions(-)
447 -
448 -diff --git a/bin/ebuild.sh b/bin/ebuild.sh
449 -index a60a24d..b592372 100755
450 ---- a/bin/ebuild.sh
451 -+++ b/bin/ebuild.sh
452 -@@ -121,7 +121,7 @@ __qa_source() {
453 - __qa_call() {
454 - local shopts=$(shopt) OLDIFS="$IFS"
455 - local retval
456 -- "$@"
457 -+ __call-ebuildshell "$@"
458 - retval=$?
459 - set +e
460 - [[ $shopts != $(shopt) ]] &&
461 -@@ -533,6 +533,150 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
462 - unset BIN_PATH BIN BODY FUNC_SRC
463 - fi
464 -
465 -+__call-ebuildshell() {
466 -+ if ! has ebuildshell ${FEATURES}; then
467 -+ "$@"
468 -+ return $?
469 -+ fi
470 -+ local __ebuildshell_args=( "$@" )
471 -+ # These are the variables I have seen 'bash -i' maintaining the values for:
472 -+ local __ebuildshell_bash_i_vars="__ebuildshell_.*
473 -+ _ BASH_ARGC BASH_ARGV BASH_COMMAND BASH_LINENO BASH_SOURCE
474 -+ BASH_VERSINFO BASH_SUBSHELL BASHOPTS BASHPID COMP_WORDBREAKS
475 -+ DIRSTACK EUID FUNCNAME GROUPS HISTCMD HISTFILE LINENO PIPESTATUS
476 -+ PPID PS1 PS2 PS3 PS4 PWD RANDOM SECONDS SHELLOPTS UID"
477 -+ # Allow recursive ebuildshell, for use in multibuild.eclass and similar:
478 -+ local __ebuildshell_pid=${BASHPID:-$(__bashpid)}
479 -+ local __ebuildshell_tmpf="${T}/ebuildshell.${__ebuildshell_pid}"
480 -+ rm -f "${__ebuildshell_tmpf}."{ebuild,return}-{env,rovars}
481 -+ (
482 -+ cat <<-EOE
483 -+ # local variables of functions using recursive ebuildshell are
484 -+ # visible to the EXIT trap of that recursive ebuildshell. To
485 -+ # keep them local, we have to filter them from that recursive
486 -+ # ebuildshell's return-env. As 'declare -p' is unable to tell
487 -+ # local-ity of variables, we abuse the trace attribute for local
488 -+ # variables to filter them from the return-env. So we need the
489 -+ # local alias active before declaring any functions.
490 -+ # On a sidehand, this allows for copy&paste of function body
491 -+ # lines including the local keyword.
492 -+ alias local='declare -t'
493 -+ shopt -s expand_aliases
494 -+ EOE
495 -+ (
496 -+ declare -p
497 -+ declare -fp
498 -+ shopt -p
499 -+ [[ ${BASH_VERSINFO[0]} == 3 ]] && export
500 -+ ) |
501 -+ (
502 -+ # we need everything but the bash vars after 'env -i'
503 -+ 2>"${__ebuildshell_tmpf}.ebuild-rovars" \
504 -+ "${PORTAGE_PYTHON:-/tools/haubi/gentoo/s01en24/usr/bin/python}" \
505 -+ "${PORTAGE_BIN_PATH}"/filter-bash-environment.py \
506 -+ --report-readonly-variables \
507 -+ --preserve-readonly-attribute \
508 -+ "${__ebuildshell_bash_i_vars}" \
509 -+ || die "filter-bash-environment.py failed"
510 -+ )
511 -+ # 'declare -g' is available since bash-4.2,
512 -+ # https://bugs.gentoo.org/show_bug.cgi?id=155161#c35
513 -+ if (( ${BASH_VERSINFO[0]} > 4 )) ||
514 -+ (( ${BASH_VERSINFO[0]} == 4 && ${BASH_VERSINFO[1]} >= 2 ))
515 -+ then
516 -+ __ebuildshell_bash42_true=
517 -+ __ebuildshell_bash42_false='#bash-4.2#'
518 -+ else
519 -+ __ebuildshell_bash42_true='#bash-4.2#'
520 -+ __ebuildshell_bash42_false=
521 -+ fi
522 -+ # The already readonly variables, without bash maintained ones:
523 -+ __ebuildshell_ro_ebuild_vars=$(<"${__ebuildshell_tmpf}.ebuild-rovars")
524 -+ cat <<-EOE
525 -+ # properly quote the function arguments
526 -+ $(declare -p __ebuildshell_args)
527 -+ set -- "\${__ebuildshell_args[@]}"
528 -+ unset __ebuildshell_args
529 -+ # be informative about what to do
530 -+ PS1="EBUILD ${PN} $1 \$ "
531 -+ type $1
532 -+ ${__ebuildshell_bash42_false}echo 'warning: preserving variables across phases requires bash-4.2'
533 -+ echo "WANTED: \$@"
534 -+ echo "or use: \"\\\$@\""
535 -+ # use bash history, but not the 'user's real one
536 -+ HISTFILE=~/.bash_history
537 -+ # but do not use history-expansion with '!',
538 -+ # for copy&paste of function body lines containing: !
539 -+ set +H
540 -+ # this is a debugging shell already
541 -+ shopt -u extdebug
542 -+ trap - DEBUG
543 -+ # at exit, dump the current environment
544 -+ trap "
545 -+ unalias local
546 -+ unset -f __call-ebuildshell
547 -+ rm -f '${__ebuildshell_tmpf}.return-'*
548 -+ (
549 -+ (
550 -+ # declare -p does not tell the -g flag,
551 -+ # so we add it by aliasing declare.
552 -+ ${__ebuildshell_bash42_true}echo \"alias declare='declare -g'\"
553 -+ declare -p
554 -+ ${__ebuildshell_bash42_true}echo \"unalias declare\"
555 -+ declare -fp
556 -+ shopt -p | grep -v '\\(expand_aliases\\|extdebug\\)$'
557 -+ $([[ ${BASH_VERSINFO[0]} == 3 ]] && echo export)
558 -+ ) |
559 -+ (
560 -+ # We may have more readonly variables now, yet we
561 -+ # need to filter variables that were readonly before.
562 -+ # And filter local variables by their trace attribute.
563 -+ 2>'${__ebuildshell_tmpf}.return-rovars' \\
564 -+ '${PORTAGE_PYTHON:-/tools/haubi/gentoo/s01en24/usr/bin/python}' \\
565 -+ '${PORTAGE_BIN_PATH}'/filter-bash-environment.py \\
566 -+ --report-readonly-variables \\
567 -+ --preserve-readonly-attribute \\
568 -+ --filter-traced-variables \\
569 -+ '${__ebuildshell_bash_i_vars} \
570 -+ ${__ebuildshell_ro_ebuild_vars}' \\
571 -+ || die 'filter-bash-environment.py failed'
572 -+ )
573 -+ ) > '${__ebuildshell_tmpf}.return-env'
574 -+ " EXIT
575 -+ # can do some cleanup right now
576 -+ rm -f '${__ebuildshell_tmpf}.ebuild-'*
577 -+ EOE
578 -+ ) > "${__ebuildshell_tmpf}.ebuild-env"
579 -+
580 -+ # pre-fill the history with "$@"
581 -+ echo '"$@"' >> ~/.bash_history
582 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} ~/.bash_history &>/dev/null
583 -+
584 -+ env -i ${BASH} --rcfile "${__ebuildshell_tmpf}.ebuild-env" -i
585 -+
586 -+ # The environment- and exit-status handling after leaving the ebuildshell
587 -+ # prompt is expected to be identical as without the ebuildshell prompt.
588 -+ local __ebuildshell_status=$?
589 -+
590 -+ # We might be in a recursive ebuildshell, but do not want
591 -+ # any aliases being active while sourcing the return-env.
592 -+ local __ebuildshell_orig_aliases=$(alias)
593 -+ unalias -a
594 -+ source "${__ebuildshell_tmpf}.return-env"
595 -+ unalias -a
596 -+ eval "${__ebuildshell_orig_aliases}"
597 -+
598 -+ # Portage has a whitelist of readonly variables: If an ebuild defines
599 -+ # additional readonly variables, their readonly attribute is removed
600 -+ # across ebuild phases. If we ever want to preserve the readonly
601 -+ # attribute of additional ebuild-defined variables across phases,
602 -+ # when returning from the ebuildshell their names are in
603 -+ # "${__ebuildshell_tmpf}.return-rovars"
604 -+ rm -f "${__ebuildshell_tmpf}."{ebuild,return}-{env,rovars}
605 -+
606 -+ return ${__ebuildshell_status}
607 -+}
608 -+
609 - # Subshell/helper die support (must export for the die helper).
610 - export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
611 - trap 'exit 1' SIGTERM
612 -diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
613 -index 029e491..0ddda7c 100755
614 ---- a/bin/filter-bash-environment.py
615 -+++ b/bin/filter-bash-environment.py
616 -@@ -14,7 +14,8 @@ func_end_re = re.compile(r'^\}$')
617 -
618 - var_assign_re = re.compile(r'(^|^declare\s+-\S+\s+|^declare\s+|^export\s+)([^=\s]+)=("|\')?.*$')
619 - close_quote_re = re.compile(r'(\\"|"|\')\s*$')
620 --readonly_re = re.compile(r'^declare\s+-(\S*)r(\S*)\s+')
621 -+readonly_re = re.compile(r'^declare\s+-(\S*)r(\S*)\s+([^=\s]+)')
622 -+trace_re = re.compile(r'^declare\s+-\S*t\S*\s+')
623 - # declare without assignment
624 - var_declare_re = re.compile(r'^declare(\s+-\S+)?\s+([^=\s]+)\s*$')
625 -
626 -@@ -29,7 +30,7 @@ def have_end_quote(quote, line):
627 - return close_quote_match is not None and \
628 - close_quote_match.group(1) == quote
629 -
630 --def filter_declare_readonly_opt(line):
631 -+def filter_declare_readonly_opt(line, options):
632 - readonly_match = readonly_re.match(line)
633 - if readonly_match is not None:
634 - declare_opts = ''
635 -@@ -37,14 +38,19 @@ def filter_declare_readonly_opt(line):
636 - group = readonly_match.group(i)
637 - if group is not None:
638 - declare_opts += group
639 -+ var = readonly_match.group(3)
640 -+ if '--report-readonly-variables' in options:
641 -+ sys.stderr.write(var + "\n")
642 -+ if '--preserve-readonly-attribute' in options:
643 -+ declare_opts += 'r'
644 - if declare_opts:
645 -- line = 'declare -%s %s' % \
646 -- (declare_opts, line[readonly_match.end():])
647 -+ line = 'declare -%s %s%s' % \
648 -+ (declare_opts, var, line[readonly_match.end():])
649 - else:
650 -- line = 'declare ' + line[readonly_match.end():]
651 -+ line = 'declare ' + var + line[readonly_match.end():]
652 - return line
653 -
654 --def filter_bash_environment(pattern, file_in, file_out):
655 -+def filter_bash_environment(pattern, file_in, file_out, options):
656 - # Filter out any instances of the \1 character from variable values
657 - # since this character multiplies each time that the environment
658 - # is saved (strange bash behavior). This can eventually result in
659 -@@ -68,6 +74,8 @@ def filter_bash_environment(pattern, file_in, file_out):
660 - quote = var_assign_match.group(3)
661 - filter_this = pattern.match(var_assign_match.group(2)) \
662 - is not None
663 -+ if not filter_this and '--filter-traced-variables' in options:
664 -+ filter_this = trace_re.match(line) is not None
665 - # Exclude the start quote when searching for the end quote,
666 - # to ensure that the start quote is not misidentified as the
667 - # end quote (happens if there is a newline immediately after
668 -@@ -77,7 +85,7 @@ def filter_bash_environment(pattern, file_in, file_out):
669 - multi_line_quote = quote
670 - multi_line_quote_filter = filter_this
671 - if not filter_this:
672 -- line = filter_declare_readonly_opt(line)
673 -+ line = filter_declare_readonly_opt(line, options)
674 - file_out.write(line.replace("\1", ""))
675 - continue
676 - else:
677 -@@ -86,8 +94,10 @@ def filter_bash_environment(pattern, file_in, file_out):
678 - # declare without assignment
679 - filter_this = pattern.match(declare_match.group(2)) \
680 - is not None
681 -+ if not filter_this and '--filter-traced-variables' in options:
682 -+ filter_this = trace_re.match(line) is not None
683 - if not filter_this:
684 -- line = filter_declare_readonly_opt(line)
685 -+ line = filter_declare_readonly_opt(line, options)
686 - file_out.write(line)
687 - continue
688 -
689 -@@ -124,13 +134,28 @@ if __name__ == "__main__":
690 - "while leaving bash function definitions and here-documents " + \
691 - "intact. The PATTERN is a space separated list of variable names" + \
692 - " and it supports python regular expression syntax."
693 -- usage = "usage: %s PATTERN" % os.path.basename(sys.argv[0])
694 -- args = sys.argv[1:]
695 --
696 -- if '-h' in args or '--help' in args:
697 -- sys.stdout.write(usage + "\n")
698 -- sys.stdout.flush()
699 -- sys.exit(os.EX_OK)
700 -+ usage = "usage: %s [-h|<options>] PATTERN" % os.path.basename(sys.argv[0])
701 -+ args = []
702 -+ known_options = {
703 -+ '--report-readonly-variables':
704 -+ "Write names of readonly variables to stderr.",
705 -+ '--preserve-readonly-attribute':
706 -+ "Preserve the '-r' flag in 'declare -r'.",
707 -+ '--filter-traced-variables':
708 -+ "Filter out variables declared with '-t' attribute."
709 -+ }
710 -+ options = {}
711 -+ for arg in sys.argv[1:]:
712 -+ if arg in known_options.keys():
713 -+ options[arg] = True
714 -+ continue
715 -+ if '-h' == arg or '--help' == arg:
716 -+ sys.stdout.write(usage + "\n\nKnown <options>:\n\n")
717 -+ for option, descr in known_options.items():
718 -+ sys.stdout.write(" " + option + "\t" + descr + "\n")
719 -+ sys.stdout.flush()
720 -+ sys.exit(os.EX_OK)
721 -+ args.append(arg)
722 -
723 - if len(args) != 1:
724 - sys.stderr.write(usage + "\n")
725 -@@ -154,5 +179,5 @@ if __name__ == "__main__":
726 -
727 - var_pattern = "^(%s)$" % "|".join(var_pattern)
728 - filter_bash_environment(
729 -- re.compile(var_pattern), file_in, file_out)
730 -+ re.compile(var_pattern), file_in, file_out, options)
731 - file_out.flush()
732 -diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
733 -index 4c6ca3f..bbb5780 100755
734 ---- a/bin/save-ebuild-env.sh
735 -+++ b/bin/save-ebuild-env.sh
736 -@@ -53,7 +53,7 @@ __save_ebuild_env() {
737 - einfo einfon ewarn eerror ebegin __eend eend KV_major \
738 - KV_minor KV_micro KV_to_int get_KV has \
739 - __has_phase_defined_up_to \
740 -- hasv hasq __qa_source __qa_call \
741 -+ hasv hasq __qa_source __qa_call __call-ebuildshell \
742 - addread addwrite adddeny addpredict __sb_append_var \
743 - use usev useq has_version portageq \
744 - best_version use_with use_enable register_die_hook \
745 -diff --git a/man/make.conf.5 b/man/make.conf.5
746 -index 653e8bc..2bb8e71 100644
747 ---- a/man/make.conf.5
748 -+++ b/man/make.conf.5
749 -@@ -408,6 +408,12 @@ exist). Also see the related \fIunmerge\-backup\fR feature.
750 - Use locks to ensure that unsandboxed ebuild phases never execute
751 - concurrently. Also see \fIparallel\-install\fR.
752 - .TP
753 -+.B ebuildshell
754 -+Drop into an interactive shell for each phase function, meant for
755 -+debugging. Because the shell would normally be used to execute the
756 -+phase function, commands like src_unpack or epatch are available in the
757 -+interactive shell. Use `die` to terminate the merge.
758 -+.TP
759 - .B fail\-clean
760 - Clean up temporary files after a build failure. This is particularly useful
761 - if you have \fBPORTAGE_TMPDIR\fR on tmpfs. If this feature is enabled, you
762 -diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
763 -index 8bd30a6..4ff78b4 100644
764 ---- a/pym/_emerge/AbstractEbuildProcess.py
765 -+++ b/pym/_emerge/AbstractEbuildProcess.py
766 -@@ -161,6 +161,7 @@ class AbstractEbuildProcess(SpawnProcess):
767 - self.fd_pipes = {}
768 - null_fd = None
769 - if 0 not in self.fd_pipes and \
770 -+ "ebuildshell" not in self.settings.features and \
771 - self.phase not in self._phases_interactive_whitelist and \
772 - "interactive" not in self.settings.get("PROPERTIES", "").split():
773 - null_fd = os.open('/dev/null', os.O_RDONLY)
774 -diff --git a/pym/portage/const.py b/pym/portage/const.py
775 -index 172c5b1..a0ad1f9 100644
776 ---- a/pym/portage/const.py
777 -+++ b/pym/portage/const.py
778 -@@ -160,6 +160,7 @@ SUPPORTED_FEATURES = frozenset([
779 - "distlocks",
780 - "downgrade-backup",
781 - "ebuild-locks",
782 -+ "ebuildshell",
783 - "fail-clean",
784 - "fakeroot",
785 - "fixlafiles",
786 ---
787 -2.10.2
788 -
789
790 diff --git a/sys-apps/portage/files/portage-2.3.40-ebuildshell.patch b/sys-apps/portage/files/portage-2.3.40-ebuildshell.patch
791 deleted file mode 100644
792 index 0c1e48a82d..0000000000
793 --- a/sys-apps/portage/files/portage-2.3.40-ebuildshell.patch
794 +++ /dev/null
795 @@ -1,354 +0,0 @@
796 -From 8c6b115fa0325b5bed2e1a9c4c8e8af45cdecc2e Mon Sep 17 00:00:00 2001
797 -From: Michael Haubenwallner <michael.haubenwallner@×××××××.at>
798 -Date: Wed, 6 Nov 2013 12:40:05 +0100
799 -Subject: [PATCH 1/2] Add ebuildshell feature, bug#155161.
800 -
801 ----
802 - bin/ebuild.sh | 146 ++++++++++++++++++++++++++++++++++-
803 - bin/filter-bash-environment.py | 55 +++++++++----
804 - bin/save-ebuild-env.sh | 2 +-
805 - man/make.conf.5 | 6 ++
806 - pym/_emerge/AbstractEbuildProcess.py | 1 +
807 - pym/portage/const.py | 1 +
808 - 6 files changed, 194 insertions(+), 17 deletions(-)
809 -
810 -diff --git a/bin/ebuild.sh b/bin/ebuild.sh
811 -index f76a48d8e..683a4e9c1 100755
812 ---- a/bin/ebuild.sh
813 -+++ b/bin/ebuild.sh
814 -@@ -121,7 +121,7 @@ __qa_source() {
815 - __qa_call() {
816 - local shopts=$(shopt) OLDIFS="$IFS"
817 - local retval
818 -- "$@"
819 -+ __call-ebuildshell "$@"
820 - retval=$?
821 - set +e
822 - [[ $shopts != $(shopt) ]] &&
823 -@@ -547,6 +547,150 @@ if [[ -n ${QA_INTERCEPTORS} ]] ; then
824 - unset BIN_PATH BIN BODY FUNC_SRC
825 - fi
826 -
827 -+__call-ebuildshell() {
828 -+ if ! has ebuildshell ${FEATURES}; then
829 -+ "$@"
830 -+ return $?
831 -+ fi
832 -+ local __ebuildshell_args=( "$@" )
833 -+ # These are the variables I have seen 'bash -i' maintaining the values for:
834 -+ local __ebuildshell_bash_i_vars="__ebuildshell_.*
835 -+ _ BASH_ARGC BASH_ARGV BASH_COMMAND BASH_LINENO BASH_SOURCE
836 -+ BASH_VERSINFO BASH_SUBSHELL BASHOPTS BASHPID COMP_WORDBREAKS
837 -+ DIRSTACK EUID FUNCNAME GROUPS HISTCMD HISTFILE LINENO PIPESTATUS
838 -+ PPID PS1 PS2 PS3 PS4 PWD RANDOM SECONDS SHELLOPTS UID"
839 -+ # Allow recursive ebuildshell, for use in multibuild.eclass and similar:
840 -+ local __ebuildshell_pid=${BASHPID:-$(__bashpid)}
841 -+ local __ebuildshell_tmpf="${T}/ebuildshell.${__ebuildshell_pid}"
842 -+ rm -f "${__ebuildshell_tmpf}."{ebuild,return}-{env,rovars}
843 -+ (
844 -+ cat <<-EOE
845 -+ # local variables of functions using recursive ebuildshell are
846 -+ # visible to the EXIT trap of that recursive ebuildshell. To
847 -+ # keep them local, we have to filter them from that recursive
848 -+ # ebuildshell's return-env. As 'declare -p' is unable to tell
849 -+ # local-ity of variables, we abuse the trace attribute for local
850 -+ # variables to filter them from the return-env. So we need the
851 -+ # local alias active before declaring any functions.
852 -+ # On a sidehand, this allows for copy&paste of function body
853 -+ # lines including the local keyword.
854 -+ alias local='declare -t'
855 -+ shopt -s expand_aliases
856 -+ EOE
857 -+ (
858 -+ declare -p
859 -+ declare -fp
860 -+ shopt -p
861 -+ [[ ${BASH_VERSINFO[0]} == 3 ]] && export
862 -+ ) |
863 -+ (
864 -+ # we need everything but the bash vars after 'env -i'
865 -+ 2>"${__ebuildshell_tmpf}.ebuild-rovars" \
866 -+ "${PORTAGE_PYTHON:-/tools/haubi/gentoo/s01en24/usr/bin/python}" \
867 -+ "${PORTAGE_BIN_PATH}"/filter-bash-environment.py \
868 -+ --report-readonly-variables \
869 -+ --preserve-readonly-attribute \
870 -+ "${__ebuildshell_bash_i_vars}" \
871 -+ || die "filter-bash-environment.py failed"
872 -+ )
873 -+ # 'declare -g' is available since bash-4.2,
874 -+ # https://bugs.gentoo.org/show_bug.cgi?id=155161#c35
875 -+ if (( ${BASH_VERSINFO[0]} > 4 )) ||
876 -+ (( ${BASH_VERSINFO[0]} == 4 && ${BASH_VERSINFO[1]} >= 2 ))
877 -+ then
878 -+ __ebuildshell_bash42_true=
879 -+ __ebuildshell_bash42_false='#bash-4.2#'
880 -+ else
881 -+ __ebuildshell_bash42_true='#bash-4.2#'
882 -+ __ebuildshell_bash42_false=
883 -+ fi
884 -+ # The already readonly variables, without bash maintained ones:
885 -+ __ebuildshell_ro_ebuild_vars=$(<"${__ebuildshell_tmpf}.ebuild-rovars")
886 -+ cat <<-EOE
887 -+ # properly quote the function arguments
888 -+ $(declare -p __ebuildshell_args)
889 -+ set -- "\${__ebuildshell_args[@]}"
890 -+ unset __ebuildshell_args
891 -+ # be informative about what to do
892 -+ PS1="EBUILD ${PN} $1 \$ "
893 -+ type $1
894 -+ ${__ebuildshell_bash42_false}echo 'warning: preserving variables across phases requires bash-4.2'
895 -+ echo "WANTED: \$@"
896 -+ echo "or use: \"\\\$@\""
897 -+ # use bash history, but not the 'user's real one
898 -+ HISTFILE=~/.bash_history
899 -+ # but do not use history-expansion with '!',
900 -+ # for copy&paste of function body lines containing: !
901 -+ set +H
902 -+ # this is a debugging shell already
903 -+ shopt -u extdebug
904 -+ trap - DEBUG
905 -+ # at exit, dump the current environment
906 -+ trap "
907 -+ unalias local
908 -+ unset -f __call-ebuildshell
909 -+ rm -f '${__ebuildshell_tmpf}.return-'*
910 -+ (
911 -+ (
912 -+ # declare -p does not tell the -g flag,
913 -+ # so we add it by aliasing declare.
914 -+ ${__ebuildshell_bash42_true}echo \"alias declare='declare -g'\"
915 -+ declare -p
916 -+ ${__ebuildshell_bash42_true}echo \"unalias declare\"
917 -+ declare -fp
918 -+ shopt -p | grep -v '\\(expand_aliases\\|extdebug\\)$'
919 -+ $([[ ${BASH_VERSINFO[0]} == 3 ]] && echo export)
920 -+ ) |
921 -+ (
922 -+ # We may have more readonly variables now, yet we
923 -+ # need to filter variables that were readonly before.
924 -+ # And filter local variables by their trace attribute.
925 -+ 2>'${__ebuildshell_tmpf}.return-rovars' \\
926 -+ '${PORTAGE_PYTHON:-/tools/haubi/gentoo/s01en24/usr/bin/python}' \\
927 -+ '${PORTAGE_BIN_PATH}'/filter-bash-environment.py \\
928 -+ --report-readonly-variables \\
929 -+ --preserve-readonly-attribute \\
930 -+ --filter-traced-variables \\
931 -+ '${__ebuildshell_bash_i_vars} \
932 -+ ${__ebuildshell_ro_ebuild_vars}' \\
933 -+ || die 'filter-bash-environment.py failed'
934 -+ )
935 -+ ) > '${__ebuildshell_tmpf}.return-env'
936 -+ " EXIT
937 -+ # can do some cleanup right now
938 -+ rm -f '${__ebuildshell_tmpf}.ebuild-'*
939 -+ EOE
940 -+ ) > "${__ebuildshell_tmpf}.ebuild-env"
941 -+
942 -+ # pre-fill the history with "$@"
943 -+ echo '"$@"' >> ~/.bash_history
944 -+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} ~/.bash_history &>/dev/null
945 -+
946 -+ env -i HOME=~ ${BASH} --rcfile "${__ebuildshell_tmpf}.ebuild-env" -i
947 -+
948 -+ # The environment- and exit-status handling after leaving the ebuildshell
949 -+ # prompt is expected to be identical as without the ebuildshell prompt.
950 -+ local __ebuildshell_status=$?
951 -+
952 -+ # We might be in a recursive ebuildshell, but do not want
953 -+ # any aliases being active while sourcing the return-env.
954 -+ local __ebuildshell_orig_aliases=$(alias)
955 -+ unalias -a
956 -+ source "${__ebuildshell_tmpf}.return-env"
957 -+ unalias -a
958 -+ eval "${__ebuildshell_orig_aliases}"
959 -+
960 -+ # Portage has a whitelist of readonly variables: If an ebuild defines
961 -+ # additional readonly variables, their readonly attribute is removed
962 -+ # across ebuild phases. If we ever want to preserve the readonly
963 -+ # attribute of additional ebuild-defined variables across phases,
964 -+ # when returning from the ebuildshell their names are in
965 -+ # "${__ebuildshell_tmpf}.return-rovars"
966 -+ rm -f "${__ebuildshell_tmpf}."{ebuild,return}-{env,rovars}
967 -+
968 -+ return ${__ebuildshell_status}
969 -+}
970 -+
971 - # Subshell/helper die support (must export for the die helper).
972 - export EBUILD_MASTER_PID=${BASHPID:-$(__bashpid)}
973 - trap 'exit 1' SIGTERM
974 -diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
975 -index 06cac7214..5590dbfc4 100755
976 ---- a/bin/filter-bash-environment.py
977 -+++ b/bin/filter-bash-environment.py
978 -@@ -12,7 +12,8 @@ func_end_re = re.compile(br'^\}$')
979 -
980 - var_assign_re = re.compile(br'(^|^declare\s+-\S+\s+|^declare\s+|^export\s+)([^=\s]+)=("|\')?.*$')
981 - close_quote_re = re.compile(br'(\\"|"|\')\s*$')
982 --readonly_re = re.compile(br'^declare\s+-(\S*)r(\S*)\s+')
983 -+readonly_re = re.compile(br'^declare\s+-(\S*)r(\S*)\s+([^=\s]+)')
984 -+trace_re = re.compile(br'^declare\s+-\S*t\S*\s+')
985 - # declare without assignment
986 - var_declare_re = re.compile(br'^declare(\s+-\S+)?\s+([^=\s]+)\s*$')
987 -
988 -@@ -27,7 +28,7 @@ def have_end_quote(quote, line):
989 - return close_quote_match is not None and \
990 - close_quote_match.group(1) == quote
991 -
992 --def filter_declare_readonly_opt(line):
993 -+def filter_declare_readonly_opt(line, options):
994 - readonly_match = readonly_re.match(line)
995 - if readonly_match is not None:
996 - declare_opts = b''
997 -@@ -35,14 +36,19 @@ def filter_declare_readonly_opt(line):
998 - group = readonly_match.group(i)
999 - if group is not None:
1000 - declare_opts += group
1001 -+ var = readonly_match.group(3)
1002 -+ if '--report-readonly-variables' in options:
1003 -+ getattr(sys.stderr, 'buffer', sys.stderr).write(var + b'\n')
1004 -+ if '--preserve-readonly-attribute' in options:
1005 -+ declare_opts += b'r'
1006 - if declare_opts:
1007 - line = b'declare -' + declare_opts + \
1008 -- b' ' + line[readonly_match.end():]
1009 -+ b' ' + var + line[readonly_match.end():]
1010 - else:
1011 -- line = b'declare ' + line[readonly_match.end():]
1012 -+ line = b'declare ' + var + line[readonly_match.end():]
1013 - return line
1014 -
1015 --def filter_bash_environment(pattern, file_in, file_out):
1016 -+def filter_bash_environment(pattern, file_in, file_out, options):
1017 - # Filter out any instances of the \1 character from variable values
1018 - # since this character multiplies each time that the environment
1019 - # is saved (strange bash behavior). This can eventually result in
1020 -@@ -66,6 +72,8 @@ def filter_bash_environment(pattern, file_in, file_out):
1021 - quote = var_assign_match.group(3)
1022 - filter_this = pattern.match(var_assign_match.group(2)) \
1023 - is not None
1024 -+ if not filter_this and '--filter-traced-variables' in options:
1025 -+ filter_this = trace_re.match(line) is not None
1026 - # Exclude the start quote when searching for the end quote,
1027 - # to ensure that the start quote is not misidentified as the
1028 - # end quote (happens if there is a newline immediately after
1029 -@@ -75,7 +83,7 @@ def filter_bash_environment(pattern, file_in, file_out):
1030 - multi_line_quote = quote
1031 - multi_line_quote_filter = filter_this
1032 - if not filter_this:
1033 -- line = filter_declare_readonly_opt(line)
1034 -+ line = filter_declare_readonly_opt(line, options)
1035 - file_out.write(line.replace(b"\1", b""))
1036 - continue
1037 - else:
1038 -@@ -84,8 +92,10 @@ def filter_bash_environment(pattern, file_in, file_out):
1039 - # declare without assignment
1040 - filter_this = pattern.match(declare_match.group(2)) \
1041 - is not None
1042 -+ if not filter_this and '--filter-traced-variables' in options:
1043 -+ filter_this = trace_re.match(line) is not None
1044 - if not filter_this:
1045 -- line = filter_declare_readonly_opt(line)
1046 -+ line = filter_declare_readonly_opt(line, options)
1047 - file_out.write(line)
1048 - continue
1049 -
1050 -@@ -122,13 +132,28 @@ if __name__ == "__main__":
1051 - "while leaving bash function definitions and here-documents " + \
1052 - "intact. The PATTERN is a space separated list of variable names" + \
1053 - " and it supports python regular expression syntax."
1054 -- usage = "usage: %s PATTERN" % os.path.basename(sys.argv[0])
1055 -- args = sys.argv[1:]
1056 --
1057 -- if '-h' in args or '--help' in args:
1058 -- sys.stdout.write(usage + "\n")
1059 -- sys.stdout.flush()
1060 -- sys.exit(os.EX_OK)
1061 -+ usage = "usage: %s [-h|<options>] PATTERN" % os.path.basename(sys.argv[0])
1062 -+ args = []
1063 -+ known_options = {
1064 -+ '--report-readonly-variables':
1065 -+ "Write names of readonly variables to stderr.",
1066 -+ '--preserve-readonly-attribute':
1067 -+ "Preserve the '-r' flag in 'declare -r'.",
1068 -+ '--filter-traced-variables':
1069 -+ "Filter out variables declared with '-t' attribute."
1070 -+ }
1071 -+ options = {}
1072 -+ for arg in sys.argv[1:]:
1073 -+ if arg in known_options.keys():
1074 -+ options[arg] = True
1075 -+ continue
1076 -+ if '-h' == arg or '--help' == arg:
1077 -+ sys.stdout.write(usage + "\n\nKnown <options>:\n\n")
1078 -+ for option, descr in known_options.items():
1079 -+ sys.stdout.write(" " + option + "\t" + descr + "\n")
1080 -+ sys.stdout.flush()
1081 -+ sys.exit(os.EX_OK)
1082 -+ args.append(arg)
1083 -
1084 - if len(args) != 1:
1085 - sys.stderr.write(usage + "\n")
1086 -@@ -151,5 +176,5 @@ if __name__ == "__main__":
1087 -
1088 - var_pattern = b'^(' + b'|'.join(var_pattern) + b')$'
1089 - filter_bash_environment(
1090 -- re.compile(var_pattern), file_in, file_out)
1091 -+ re.compile(var_pattern), file_in, file_out, options)
1092 - file_out.flush()
1093 -diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
1094 -index bb17382d4..af35a3327 100755
1095 ---- a/bin/save-ebuild-env.sh
1096 -+++ b/bin/save-ebuild-env.sh
1097 -@@ -53,7 +53,7 @@ __save_ebuild_env() {
1098 - einfo einfon ewarn eerror ebegin __eend eend KV_major \
1099 - KV_minor KV_micro KV_to_int get_KV has \
1100 - __has_phase_defined_up_to \
1101 -- hasv hasq __qa_source __qa_call \
1102 -+ hasv hasq __qa_source __qa_call __call-ebuildshell \
1103 - addread addwrite adddeny addpredict __sb_append_var \
1104 - use usev useq has_version portageq \
1105 - best_version use_with use_enable register_die_hook \
1106 -diff --git a/man/make.conf.5 b/man/make.conf.5
1107 -index b0c1aa4f2..568f350a0 100644
1108 ---- a/man/make.conf.5
1109 -+++ b/man/make.conf.5
1110 -@@ -408,6 +408,12 @@ exist). Also see the related \fIunmerge\-backup\fR feature.
1111 - Use locks to ensure that unsandboxed ebuild phases never execute
1112 - concurrently. Also see \fIparallel\-install\fR.
1113 - .TP
1114 -+.B ebuildshell
1115 -+Drop into an interactive shell for each phase function, meant for
1116 -+debugging. Because the shell would normally be used to execute the
1117 -+phase function, commands like src_unpack or epatch are available in the
1118 -+interactive shell. Use `die` to terminate the merge.
1119 -+.TP
1120 - .B fail\-clean
1121 - Clean up temporary files after a build failure. This is particularly useful
1122 - if you have \fBPORTAGE_TMPDIR\fR on tmpfs. If this feature is enabled, you
1123 -diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
1124 -index 370cac529..a521596e5 100644
1125 ---- a/pym/_emerge/AbstractEbuildProcess.py
1126 -+++ b/pym/_emerge/AbstractEbuildProcess.py
1127 -@@ -181,6 +181,7 @@ class AbstractEbuildProcess(SpawnProcess):
1128 - self.fd_pipes = {}
1129 - null_fd = None
1130 - if 0 not in self.fd_pipes and \
1131 -+ "ebuildshell" not in self.settings.features and \
1132 - self.phase not in self._phases_interactive_whitelist and \
1133 - "interactive" not in self.settings.get("PROPERTIES", "").split():
1134 - null_fd = os.open('/dev/null', os.O_RDONLY)
1135 -diff --git a/pym/portage/const.py b/pym/portage/const.py
1136 -index 3c23c85ed..d9c57f300 100644
1137 ---- a/pym/portage/const.py
1138 -+++ b/pym/portage/const.py
1139 -@@ -161,6 +161,7 @@ SUPPORTED_FEATURES = frozenset([
1140 - "distlocks",
1141 - "downgrade-backup",
1142 - "ebuild-locks",
1143 -+ "ebuildshell",
1144 - "fail-clean",
1145 - "fakeroot",
1146 - "fixlafiles",
1147 ---
1148 -2.16.1
1149 -
1150
1151 diff --git a/sys-apps/portage/files/portage-ccache.conf b/sys-apps/portage/files/portage-ccache.conf
1152 new file mode 100644
1153 index 0000000000..37857fde31
1154 --- /dev/null
1155 +++ b/sys-apps/portage/files/portage-ccache.conf
1156 @@ -0,0 +1,2 @@
1157 +# Prevent ccache files from being cleaned
1158 +x /var/tmp/ccache
1159
1160 diff --git a/sys-apps/portage/metadata.xml b/sys-apps/portage/metadata.xml
1161 index 1ffd22f625..062dafe624 100644
1162 --- a/sys-apps/portage/metadata.xml
1163 +++ b/sys-apps/portage/metadata.xml
1164 @@ -11,7 +11,6 @@
1165 <email>dev-portage@g.o</email>
1166 </maintainer>
1167 <use>
1168 - <flag name="epydoc">Build html API documentation with epydoc.</flag>
1169 <flag name="apidoc">Build html API documentation with sphinx-apidoc.</flag>
1170 <flag name="gentoo-dev">Enable features required for Gentoo ebuild development.</flag>
1171 <flag name="ipc">Use inter-process communication between portage and
1172
1173 diff --git a/sys-apps/portage/portage-2.3.100.ebuild b/sys-apps/portage/portage-2.3.100.ebuild
1174 deleted file mode 100644
1175 index a651d7eeb5..0000000000
1176 --- a/sys-apps/portage/portage-2.3.100.ebuild
1177 +++ /dev/null
1178 @@ -1,264 +0,0 @@
1179 -# Copyright 1999-2020 Gentoo Authors
1180 -# Distributed under the terms of the GNU General Public License v2
1181 -
1182 -EAPI=5
1183 -
1184 -PYTHON_COMPAT=(
1185 - pypy3
1186 - python3_{6,7,8,9}
1187 - python2_7
1188 -)
1189 -PYTHON_REQ_USE='bzip2(+),threads(+)'
1190 -
1191 -inherit eutils distutils-r1 multilib
1192 -
1193 -DESCRIPTION="Portage package manager used in Gentoo Prefix"
1194 -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
1195 -LICENSE="GPL-2"
1196 -KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1197 -SLOT="0"
1198 -IUSE="build doc epydoc +ipc +native-extensions selinux xattr"
1199 -
1200 -DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
1201 - >=app-arch/tar-1.27
1202 - dev-lang/python-exec:2
1203 - >=sys-apps/sed-4.0.5 sys-devel/patch
1204 - doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
1205 - epydoc? ( >=dev-python/epydoc-2.0[$(python_gen_usedep 'python2*')] )"
1206 -# Require sandbox-2.2 for bug #288863.
1207 -# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
1208 -# quite slow, so it's not considered in the dependencies as an alternative to
1209 -# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
1210 -# for now, don't pull in xattr deps for other kernels.
1211 -# For whirlpool hash, require python[ssl] (bug #425046).
1212 -# For compgen, require bash[readline] (bug #445576).
1213 -RDEPEND="
1214 - >=app-arch/tar-1.27
1215 - dev-lang/python-exec:2
1216 - !build? (
1217 - >=sys-apps/sed-4.0.5
1218 - app-shells/bash:0[readline]
1219 - >=app-admin/eselect-1.2
1220 - $(python_gen_cond_dep 'dev-python/pyblake2[${PYTHON_USEDEP}]' \
1221 - python{2_7,3_4,3_5} pypy)
1222 - )
1223 - elibc_FreeBSD? ( !prefix? ( sys-freebsd/freebsd-bin ) )
1224 - elibc_glibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
1225 - elibc_uclibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
1226 - kernel_linux? ( >=app-misc/pax-utils-0.1.17 )
1227 - kernel_SunOS? ( >=app-misc/pax-utils-0.1.17 )
1228 - kernel_FreeBSD? ( >=app-misc/pax-utils-0.1.17 )
1229 - kernel_Darwin? ( >=app-misc/pax-utils-0.1.18 )
1230 - kernel_AIX? ( >=sys-apps/aix-miscutils-0.1.1634 )
1231 - selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
1232 - xattr? ( kernel_linux? (
1233 - >=sys-apps/install-xattr-0.3
1234 - $(python_gen_cond_dep 'dev-python/pyxattr[${PYTHON_USEDEP}]' \
1235 - python2_7 pypy)
1236 - ) )
1237 - !<app-admin/logrotate-3.8.0"
1238 -PDEPEND="
1239 - !build? (
1240 - >=net-misc/rsync-2.6.4
1241 - userland_GNU? ( >=sys-apps/coreutils-6.4 )
1242 - )"
1243 -# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
1244 -# NOTE: FEATURES=installsources requires debugedit and rsync
1245 -
1246 -REQUIRED_USE="epydoc? ( $(python_gen_useflags 'python2*') )"
1247 -
1248 -SRC_ARCHIVES="https://dev.gentoo.org/~zmedico/portage/archives https://dev.gentoo.org/~grobian/distfiles"
1249 -
1250 -prefix_src_archives() {
1251 - local x y
1252 - for x in ${@}; do
1253 - for y in ${SRC_ARCHIVES}; do
1254 - echo ${y}/${x}
1255 - done
1256 - done
1257 -}
1258 -
1259 -TARBALL_PV=${PV}
1260 -SRC_URI="mirror://gentoo/prefix-${PN}-${TARBALL_PV}.tar.bz2
1261 - $(prefix_src_archives prefix-${PN}-${TARBALL_PV}.tar.bz2)"
1262 -
1263 -S="${WORKDIR}"/prefix-${PN}-${TARBALL_PV}
1264 -
1265 -pkg_setup() {
1266 - use epydoc && DISTUTILS_ALL_SUBPHASE_IMPLS=( python2.7 )
1267 -}
1268 -
1269 -python_prepare_all() {
1270 - distutils-r1_python_prepare_all
1271 -
1272 - epatch "${FILESDIR}"/${PN}-2.3.62-prefix-stack.patch # 658572
1273 - epatch "${FILESDIR}"/${PN}-2.3.45-ebuildshell.patch # 155161
1274 -
1275 - if use native-extensions; then
1276 - printf "[build_ext]\nportage-ext-modules=true\n" >> \
1277 - setup.cfg || die
1278 - fi
1279 -
1280 - if ! use ipc ; then
1281 - einfo "Disabling ipc..."
1282 - sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
1283 - -i lib/_emerge/AbstractEbuildProcess.py || \
1284 - die "failed to patch AbstractEbuildProcess.py"
1285 - fi
1286 -
1287 - if use xattr && use kernel_linux ; then
1288 - einfo "Adding FEATURES=xattr to make.globals ..."
1289 - echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
1290 - || die "failed to append to make.globals"
1291 - fi
1292 -
1293 - if [[ -n ${EPREFIX} ]] ; then
1294 - # PREFIX LOCAL: only hack const_autotool
1295 - local extrapath="/usr/sbin:/usr/bin:/sbin:/bin"
1296 - # ok, we can't rely on PORTAGE_ROOT_USER being there yet, as people
1297 - # tend not to update that often, as long as we are a separate ebuild
1298 - # we can assume when unset, it's time for some older trick
1299 - if [[ -z ${PORTAGE_ROOT_USER} ]] ; then
1300 - PORTAGE_ROOT_USER=$(python -c 'from portage.const import rootuser; print rootuser')
1301 - fi
1302 - # We need to probe for bash in the Prefix, because it may not
1303 - # exist, in which case we fall back to the currently in use
1304 - # bash. This logic is necessary in particular during bootstrap,
1305 - # where we pull ourselves out of a temporary place with tools
1306 - local bash="${EPREFIX}/bin/bash"
1307 - [[ ! -x ${bash} ]] && bash=${BASH}
1308 -
1309 - einfo "Adjusting sources for ${EPREFIX}"
1310 - find . -type f -exec \
1311 - sed -e "s|@PORTAGE_EPREFIX@|${EPREFIX}|" \
1312 - -e "s|@PORTAGE_MV@|$(type -P mv)|" \
1313 - -e "s|@PORTAGE_BASH@|${bash}|" \
1314 - -e "s|@PREFIX_PORTAGE_PYTHON@|$(type -P python)|" \
1315 - -e "s|@EXTRA_PATH@|${extrapath}|" \
1316 - -e "s|@portagegroup@|${PORTAGE_GROUP:-portage}|" \
1317 - -e "s|@portageuser@|${PORTAGE_USER:-portage}|" \
1318 - -e "s|@rootuser@|${PORTAGE_ROOT_USER:-root}|" \
1319 - -e "s|@rootuid@|$(id -u ${PORTAGE_ROOT_USER:-root})|" \
1320 - -e "s|@rootgid@|$(id -g ${PORTAGE_ROOT_USER:-root})|" \
1321 - -e "s|@sysconfdir@|${EPREFIX}/etc|" \
1322 - -i '{}' + || \
1323 - die "Failed to patch sources"
1324 - # We don't need the below, since setup.py deals with this (and
1325 - # more) so we don't have to make this correct
1326 - # -e "s|@PORTAGE_BASE@|${EPREFIX}/usr/lib/portage/${EPYTHON}|" \
1327 -
1328 - # remove Makefiles, or else they will get installed
1329 - find . -name "Makefile.*" -delete
1330 -
1331 - einfo "Prefixing shebangs ..."
1332 - while read -r -d $'\0' ; do
1333 - local shebang=$(head -n1 "$REPLY")
1334 - if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
1335 - sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
1336 - die "sed failed"
1337 - fi
1338 - done < <(find . -type f -print0)
1339 -
1340 - einfo "Setting gentoo_prefix as reponame for emerge-webrsync"
1341 - sed -i -e 's/repo_name=gentoo/repo_name=gentoo_prefix/' \
1342 - bin/emerge-webrsync || die
1343 -
1344 - einfo "Making absent gemato non-fatal"
1345 - sed -i -e '/exitcode = 127/d' \
1346 - lib/portage/sync/modules/rsync/rsync.py || die
1347 - # END PREFIX LOCAL
1348 - fi
1349 -
1350 - # PREFIX LOCAL: make.conf is written by bootstrap-prefix.sh
1351 - if use !prefix ; then
1352 - cd "${S}/cnf" || die
1353 - if [ -f "make.conf.example.${ARCH}".diff ]; then
1354 - patch make.conf.example "make.conf.example.${ARCH}".diff || \
1355 - die "Failed to patch make.conf.example"
1356 - else
1357 - eerror ""
1358 - eerror "Portage does not have an arch-specific configuration for this arch."
1359 - eerror "Please notify the arch maintainer about this issue. Using generic."
1360 - eerror ""
1361 - fi
1362 - fi
1363 -}
1364 -
1365 -python_compile_all() {
1366 - local targets=()
1367 - use doc && targets+=( docbook )
1368 - use epydoc && targets+=( epydoc )
1369 -
1370 - if [[ ${targets[@]} ]]; then
1371 - esetup.py "${targets[@]}"
1372 - fi
1373 -}
1374 -
1375 -python_test() {
1376 - esetup.py test
1377 -}
1378 -
1379 -python_install() {
1380 - # Install sbin scripts to bindir for python-exec linking
1381 - # they will be relocated in pkg_preinst()
1382 - distutils-r1_python_install \
1383 - --system-prefix="${EPREFIX}/usr" \
1384 - --bindir="$(python_get_scriptdir)" \
1385 - --docdir="${EPREFIX}/usr/share/doc/${PF}" \
1386 - --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
1387 - --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
1388 - --sbindir="$(python_get_scriptdir)" \
1389 - --sysconfdir="${EPREFIX}/etc" \
1390 - "${@}"
1391 -}
1392 -
1393 -python_install_all() {
1394 - distutils-r1_python_install_all
1395 -
1396 - local targets=()
1397 - use doc && targets+=(
1398 - install_docbook
1399 - --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
1400 - )
1401 - use epydoc && targets+=(
1402 - install_epydoc
1403 - --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
1404 - )
1405 -
1406 - # install docs
1407 - if [[ ${targets[@]} ]]; then
1408 - esetup.py "${targets[@]}"
1409 - fi
1410 -
1411 - # Due to distutils/python-exec limitations
1412 - # these must be installed to /usr/bin.
1413 - local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
1414 - einfo "Moving admin scripts to the correct directory"
1415 - dodir /usr/sbin
1416 - for target in ${sbin_relocations}; do
1417 - einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
1418 - mv "${ED}usr/bin/${target}" "${ED}usr/sbin/${target}" || die "sbin scripts move failed!"
1419 - done
1420 -}
1421 -
1422 -pkg_preinst() {
1423 - # comment out sanity test until it is fixed to work
1424 - # with the new PORTAGE_PYM_PATH
1425 - #if [[ $ROOT == / ]] ; then
1426 - ## Run some minimal tests as a sanity check.
1427 - #local test_runner=$(find "${ED}" -name runTests)
1428 - #if [[ -n $test_runner && -x $test_runner ]] ; then
1429 - #einfo "Running preinst sanity tests..."
1430 - #"$test_runner" || die "preinst sanity tests failed"
1431 - #fi
1432 - #fi
1433 -
1434 - # elog dir must exist to avoid logrotate error for bug #415911.
1435 - # This code runs in preinst in order to bypass the mapping of
1436 - # portage:portage to root:root which happens after src_install.
1437 - keepdir /var/log/portage/elog
1438 - # This is allowed to fail if the user/group are invalid for prefix users.
1439 - if chown ${PORTAGE_USER}:${PORTAGE_GROUP} "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
1440 - chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
1441 - fi
1442 -}
1443
1444 diff --git a/sys-apps/portage/portage-2.3.68.ebuild b/sys-apps/portage/portage-2.3.68.ebuild
1445 deleted file mode 100644
1446 index 083ed2521d..0000000000
1447 --- a/sys-apps/portage/portage-2.3.68.ebuild
1448 +++ /dev/null
1449 @@ -1,264 +0,0 @@
1450 -# Copyright 1999-2020 Gentoo Authors
1451 -# Distributed under the terms of the GNU General Public License v2
1452 -
1453 -EAPI=5
1454 -
1455 -PYTHON_COMPAT=(
1456 - pypy3
1457 - python3_6 python3_7
1458 - python2_7
1459 -)
1460 -PYTHON_REQ_USE='bzip2(+),threads(+)'
1461 -
1462 -inherit eutils distutils-r1 multilib
1463 -
1464 -DESCRIPTION="Portage package manager used in Gentoo Prefix"
1465 -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
1466 -LICENSE="GPL-2"
1467 -KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1468 -SLOT="0"
1469 -IUSE="build doc epydoc +ipc +native-extensions selinux xattr"
1470 -
1471 -DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
1472 - >=app-arch/tar-1.27
1473 - dev-lang/python-exec:2
1474 - >=sys-apps/sed-4.0.5 sys-devel/patch
1475 - doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
1476 - epydoc? ( >=dev-python/epydoc-2.0[$(python_gen_usedep 'python2*')] )"
1477 -# Require sandbox-2.2 for bug #288863.
1478 -# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
1479 -# quite slow, so it's not considered in the dependencies as an alternative to
1480 -# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
1481 -# for now, don't pull in xattr deps for other kernels.
1482 -# For whirlpool hash, require python[ssl] (bug #425046).
1483 -# For compgen, require bash[readline] (bug #445576).
1484 -RDEPEND="
1485 - >=app-arch/tar-1.27
1486 - dev-lang/python-exec:2
1487 - !build? (
1488 - >=sys-apps/sed-4.0.5
1489 - app-shells/bash:0[readline]
1490 - >=app-admin/eselect-1.2
1491 - $(python_gen_cond_dep 'dev-python/pyblake2[${PYTHON_USEDEP}]' \
1492 - python{2_7,3_4,3_5} pypy)
1493 - )
1494 - elibc_FreeBSD? ( !prefix? ( sys-freebsd/freebsd-bin ) )
1495 - elibc_glibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
1496 - elibc_uclibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
1497 - kernel_linux? ( >=app-misc/pax-utils-0.1.17 )
1498 - kernel_SunOS? ( >=app-misc/pax-utils-0.1.17 )
1499 - kernel_FreeBSD? ( >=app-misc/pax-utils-0.1.17 )
1500 - kernel_Darwin? ( >=app-misc/pax-utils-0.1.18 )
1501 - kernel_AIX? ( >=sys-apps/aix-miscutils-0.1.1634 )
1502 - selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
1503 - xattr? ( kernel_linux? (
1504 - >=sys-apps/install-xattr-0.3
1505 - $(python_gen_cond_dep 'dev-python/pyxattr[${PYTHON_USEDEP}]' \
1506 - python2_7 pypy)
1507 - ) )
1508 - !<app-admin/logrotate-3.8.0"
1509 -PDEPEND="
1510 - !build? (
1511 - >=net-misc/rsync-2.6.4
1512 - userland_GNU? ( >=sys-apps/coreutils-6.4 )
1513 - )"
1514 -# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
1515 -# NOTE: FEATURES=installsources requires debugedit and rsync
1516 -
1517 -REQUIRED_USE="epydoc? ( $(python_gen_useflags 'python2*') )"
1518 -
1519 -SRC_ARCHIVES="https://dev.gentoo.org/~zmedico/portage/archives https://dev.gentoo.org/~grobian/distfiles"
1520 -
1521 -prefix_src_archives() {
1522 - local x y
1523 - for x in ${@}; do
1524 - for y in ${SRC_ARCHIVES}; do
1525 - echo ${y}/${x}
1526 - done
1527 - done
1528 -}
1529 -
1530 -TARBALL_PV=${PV}
1531 -SRC_URI="mirror://gentoo/prefix-${PN}-${TARBALL_PV}.tar.bz2
1532 - $(prefix_src_archives prefix-${PN}-${TARBALL_PV}.tar.bz2)"
1533 -
1534 -S="${WORKDIR}"/prefix-${PN}-${TARBALL_PV}
1535 -
1536 -pkg_setup() {
1537 - use epydoc && DISTUTILS_ALL_SUBPHASE_IMPLS=( python2.7 )
1538 -}
1539 -
1540 -python_prepare_all() {
1541 - distutils-r1_python_prepare_all
1542 -
1543 - epatch "${FILESDIR}"/${PN}-2.3.62-prefix-stack.patch # 658572
1544 - epatch "${FILESDIR}"/${PN}-2.3.45-ebuildshell.patch # 155161
1545 -
1546 - if use native-extensions; then
1547 - printf "[build_ext]\nportage-ext-modules=true\n" >> \
1548 - setup.cfg || die
1549 - fi
1550 -
1551 - if ! use ipc ; then
1552 - einfo "Disabling ipc..."
1553 - sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
1554 - -i lib/_emerge/AbstractEbuildProcess.py || \
1555 - die "failed to patch AbstractEbuildProcess.py"
1556 - fi
1557 -
1558 - if use xattr && use kernel_linux ; then
1559 - einfo "Adding FEATURES=xattr to make.globals ..."
1560 - echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
1561 - || die "failed to append to make.globals"
1562 - fi
1563 -
1564 - if [[ -n ${EPREFIX} ]] ; then
1565 - # PREFIX LOCAL: only hack const_autotool
1566 - local extrapath="/usr/sbin:/usr/bin:/sbin:/bin"
1567 - # ok, we can't rely on PORTAGE_ROOT_USER being there yet, as people
1568 - # tend not to update that often, as long as we are a separate ebuild
1569 - # we can assume when unset, it's time for some older trick
1570 - if [[ -z ${PORTAGE_ROOT_USER} ]] ; then
1571 - PORTAGE_ROOT_USER=$(python -c 'from portage.const import rootuser; print rootuser')
1572 - fi
1573 - # We need to probe for bash in the Prefix, because it may not
1574 - # exist, in which case we fall back to the currently in use
1575 - # bash. This logic is necessary in particular during bootstrap,
1576 - # where we pull ourselves out of a temporary place with tools
1577 - local bash="${EPREFIX}/bin/bash"
1578 - [[ ! -x ${bash} ]] && bash=${BASH}
1579 -
1580 - einfo "Adjusting sources for ${EPREFIX}"
1581 - find . -type f -exec \
1582 - sed -e "s|@PORTAGE_EPREFIX@|${EPREFIX}|" \
1583 - -e "s|@PORTAGE_MV@|$(type -P mv)|" \
1584 - -e "s|@PORTAGE_BASH@|${bash}|" \
1585 - -e "s|@PREFIX_PORTAGE_PYTHON@|$(type -P python)|" \
1586 - -e "s|@EXTRA_PATH@|${extrapath}|" \
1587 - -e "s|@portagegroup@|${PORTAGE_GROUP:-portage}|" \
1588 - -e "s|@portageuser@|${PORTAGE_USER:-portage}|" \
1589 - -e "s|@rootuser@|${PORTAGE_ROOT_USER:-root}|" \
1590 - -e "s|@rootuid@|$(id -u ${PORTAGE_ROOT_USER:-root})|" \
1591 - -e "s|@rootgid@|$(id -g ${PORTAGE_ROOT_USER:-root})|" \
1592 - -e "s|@sysconfdir@|${EPREFIX}/etc|" \
1593 - -i '{}' + || \
1594 - die "Failed to patch sources"
1595 - # We don't need the below, since setup.py deals with this (and
1596 - # more) so we don't have to make this correct
1597 - # -e "s|@PORTAGE_BASE@|${EPREFIX}/usr/lib/portage/${EPYTHON}|" \
1598 -
1599 - # remove Makefiles, or else they will get installed
1600 - find . -name "Makefile.*" -delete
1601 -
1602 - einfo "Prefixing shebangs ..."
1603 - while read -r -d $'\0' ; do
1604 - local shebang=$(head -n1 "$REPLY")
1605 - if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
1606 - sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
1607 - die "sed failed"
1608 - fi
1609 - done < <(find . -type f -print0)
1610 -
1611 - einfo "Setting gentoo_prefix as reponame for emerge-webrsync"
1612 - sed -i -e 's/repo_name=gentoo/repo_name=gentoo_prefix/' \
1613 - bin/emerge-webrsync || die
1614 -
1615 - einfo "Making absent gemato non-fatal"
1616 - sed -i -e '/exitcode = 127/d' \
1617 - lib/portage/sync/modules/rsync/rsync.py || die
1618 - # END PREFIX LOCAL
1619 - fi
1620 -
1621 - # PREFIX LOCAL: make.conf is written by bootstrap-prefix.sh
1622 - if use !prefix ; then
1623 - cd "${S}/cnf" || die
1624 - if [ -f "make.conf.example.${ARCH}".diff ]; then
1625 - patch make.conf.example "make.conf.example.${ARCH}".diff || \
1626 - die "Failed to patch make.conf.example"
1627 - else
1628 - eerror ""
1629 - eerror "Portage does not have an arch-specific configuration for this arch."
1630 - eerror "Please notify the arch maintainer about this issue. Using generic."
1631 - eerror ""
1632 - fi
1633 - fi
1634 -}
1635 -
1636 -python_compile_all() {
1637 - local targets=()
1638 - use doc && targets+=( docbook )
1639 - use epydoc && targets+=( epydoc )
1640 -
1641 - if [[ ${targets[@]} ]]; then
1642 - esetup.py "${targets[@]}"
1643 - fi
1644 -}
1645 -
1646 -python_test() {
1647 - esetup.py test
1648 -}
1649 -
1650 -python_install() {
1651 - # Install sbin scripts to bindir for python-exec linking
1652 - # they will be relocated in pkg_preinst()
1653 - distutils-r1_python_install \
1654 - --system-prefix="${EPREFIX}/usr" \
1655 - --bindir="$(python_get_scriptdir)" \
1656 - --docdir="${EPREFIX}/usr/share/doc/${PF}" \
1657 - --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
1658 - --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
1659 - --sbindir="$(python_get_scriptdir)" \
1660 - --sysconfdir="${EPREFIX}/etc" \
1661 - "${@}"
1662 -}
1663 -
1664 -python_install_all() {
1665 - distutils-r1_python_install_all
1666 -
1667 - local targets=()
1668 - use doc && targets+=(
1669 - install_docbook
1670 - --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
1671 - )
1672 - use epydoc && targets+=(
1673 - install_epydoc
1674 - --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
1675 - )
1676 -
1677 - # install docs
1678 - if [[ ${targets[@]} ]]; then
1679 - esetup.py "${targets[@]}"
1680 - fi
1681 -
1682 - # Due to distutils/python-exec limitations
1683 - # these must be installed to /usr/bin.
1684 - local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
1685 - einfo "Moving admin scripts to the correct directory"
1686 - dodir /usr/sbin
1687 - for target in ${sbin_relocations}; do
1688 - einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
1689 - mv "${ED}usr/bin/${target}" "${ED}usr/sbin/${target}" || die "sbin scripts move failed!"
1690 - done
1691 -}
1692 -
1693 -pkg_preinst() {
1694 - # comment out sanity test until it is fixed to work
1695 - # with the new PORTAGE_PYM_PATH
1696 - #if [[ $ROOT == / ]] ; then
1697 - ## Run some minimal tests as a sanity check.
1698 - #local test_runner=$(find "${ED}" -name runTests)
1699 - #if [[ -n $test_runner && -x $test_runner ]] ; then
1700 - #einfo "Running preinst sanity tests..."
1701 - #"$test_runner" || die "preinst sanity tests failed"
1702 - #fi
1703 - #fi
1704 -
1705 - # elog dir must exist to avoid logrotate error for bug #415911.
1706 - # This code runs in preinst in order to bypass the mapping of
1707 - # portage:portage to root:root which happens after src_install.
1708 - keepdir /var/log/portage/elog
1709 - # This is allowed to fail if the user/group are invalid for prefix users.
1710 - if chown ${PORTAGE_USER}:${PORTAGE_GROUP} "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
1711 - chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
1712 - fi
1713 -}
1714
1715 diff --git a/sys-apps/portage/portage-2.3.84.ebuild b/sys-apps/portage/portage-3.0.1.ebuild
1716 similarity index 70%
1717 rename from sys-apps/portage/portage-2.3.84.ebuild
1718 rename to sys-apps/portage/portage-3.0.1.ebuild
1719 index 083ed2521d..cf3cc74f4b 100644
1720 --- a/sys-apps/portage/portage-2.3.84.ebuild
1721 +++ b/sys-apps/portage/portage-3.0.1.ebuild
1722 @@ -1,46 +1,49 @@
1723 # Copyright 1999-2020 Gentoo Authors
1724 # Distributed under the terms of the GNU General Public License v2
1725
1726 -EAPI=5
1727 +EAPI=7
1728
1729 -PYTHON_COMPAT=(
1730 - pypy3
1731 - python3_6 python3_7
1732 - python2_7
1733 -)
1734 +DISTUTILS_USE_SETUPTOOLS=no
1735 +PYTHON_COMPAT=( pypy3 python3_{6..9} )
1736 PYTHON_REQ_USE='bzip2(+),threads(+)'
1737
1738 -inherit eutils distutils-r1 multilib
1739 +inherit distutils-r1 linux-info systemd prefix
1740
1741 DESCRIPTION="Portage package manager used in Gentoo Prefix"
1742 HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
1743 +
1744 LICENSE="GPL-2"
1745 KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
1746 SLOT="0"
1747 -IUSE="build doc epydoc +ipc +native-extensions selinux xattr"
1748 +IUSE="apidoc build doc gentoo-dev +ipc +native-extensions rsync-verify selinux xattr"
1749
1750 DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
1751 >=app-arch/tar-1.27
1752 dev-lang/python-exec:2
1753 >=sys-apps/sed-4.0.5 sys-devel/patch
1754 doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
1755 - epydoc? ( >=dev-python/epydoc-2.0[$(python_gen_usedep 'python2*')] )"
1756 + apidoc? (
1757 + dev-python/sphinx
1758 + dev-python/sphinx-epytext
1759 + )"
1760 # Require sandbox-2.2 for bug #288863.
1761 -# For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
1762 -# quite slow, so it's not considered in the dependencies as an alternative to
1763 -# to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
1764 -# for now, don't pull in xattr deps for other kernels.
1765 # For whirlpool hash, require python[ssl] (bug #425046).
1766 # For compgen, require bash[readline] (bug #445576).
1767 +# app-portage/gemato goes without PYTHON_USEDEP since we're calling
1768 +# the executable.
1769 RDEPEND="
1770 + app-arch/zstd
1771 >=app-arch/tar-1.27
1772 dev-lang/python-exec:2
1773 !build? (
1774 >=sys-apps/sed-4.0.5
1775 app-shells/bash:0[readline]
1776 >=app-admin/eselect-1.2
1777 - $(python_gen_cond_dep 'dev-python/pyblake2[${PYTHON_USEDEP}]' \
1778 - python{2_7,3_4,3_5} pypy)
1779 + rsync-verify? (
1780 + >=app-portage/gemato-14[${PYTHON_USEDEP}]
1781 + >=app-crypt/openpgp-keys-gentoo-release-20180706
1782 + >=app-crypt/gnupg-2.2.4-r2[ssl(-)]
1783 + )
1784 )
1785 elibc_FreeBSD? ( !prefix? ( sys-freebsd/freebsd-bin ) )
1786 elibc_glibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
1787 @@ -53,10 +56,10 @@ RDEPEND="
1788 selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
1789 xattr? ( kernel_linux? (
1790 >=sys-apps/install-xattr-0.3
1791 - $(python_gen_cond_dep 'dev-python/pyxattr[${PYTHON_USEDEP}]' \
1792 - python2_7 pypy)
1793 ) )
1794 - !<app-admin/logrotate-3.8.0"
1795 + !<app-admin/logrotate-3.8.0
1796 + !<app-portage/gentoolkit-0.4.6
1797 + !<app-portage/repoman-2.3.10"
1798 PDEPEND="
1799 !build? (
1800 >=net-misc/rsync-2.6.4
1801 @@ -65,8 +68,6 @@ PDEPEND="
1802 # coreutils-6.4 rdep is for date format in emerge-webrsync #164532
1803 # NOTE: FEATURES=installsources requires debugedit and rsync
1804
1805 -REQUIRED_USE="epydoc? ( $(python_gen_useflags 'python2*') )"
1806 -
1807 SRC_ARCHIVES="https://dev.gentoo.org/~zmedico/portage/archives https://dev.gentoo.org/~grobian/distfiles"
1808
1809 prefix_src_archives() {
1810 @@ -84,15 +85,27 @@ SRC_URI="mirror://gentoo/prefix-${PN}-${TARBALL_PV}.tar.bz2
1811
1812 S="${WORKDIR}"/prefix-${PN}-${TARBALL_PV}
1813
1814 -pkg_setup() {
1815 - use epydoc && DISTUTILS_ALL_SUBPHASE_IMPLS=( python2.7 )
1816 +pkg_pretend() {
1817 + local CONFIG_CHECK="~IPC_NS ~PID_NS ~NET_NS ~UTS_NS"
1818 +
1819 + check_extra_config
1820 }
1821
1822 python_prepare_all() {
1823 distutils-r1_python_prepare_all
1824
1825 - epatch "${FILESDIR}"/${PN}-2.3.62-prefix-stack.patch # 658572
1826 - epatch "${FILESDIR}"/${PN}-2.3.45-ebuildshell.patch # 155161
1827 + eapply "${FILESDIR}"/${PN}-2.3.62-prefix-stack.patch # 658572
1828 + eapply "${FILESDIR}"/${PN}-2.3.45-ebuildshell.patch # 155161
1829 + if use gentoo-dev; then
1830 + einfo "Disabling --dynamic-deps by default for gentoo-dev..."
1831 + sed -e 's:\("--dynamic-deps", \)\("y"\):\1"n":' \
1832 + -i lib/_emerge/create_depgraph_params.py || \
1833 + die "failed to patch create_depgraph_params.py"
1834 +
1835 + einfo "Enabling additional FEATURES for gentoo-dev..."
1836 + echo 'FEATURES="${FEATURES} strict-keepdir"' \
1837 + >> cnf/make.globals || die
1838 + fi
1839
1840 if use native-extensions; then
1841 printf "[build_ext]\nportage-ext-modules=true\n" >> \
1842 @@ -112,6 +125,12 @@ python_prepare_all() {
1843 || die "failed to append to make.globals"
1844 fi
1845
1846 + if use build || ! use rsync-verify; then
1847 + sed -e '/^sync-rsync-verify-metamanifest/s|yes|no|' \
1848 + -e '/^sync-webrsync-verify-signature/s|yes|no|' \
1849 + -i cnf/repos.conf || die "sed failed"
1850 + fi
1851 +
1852 if [[ -n ${EPREFIX} ]] ; then
1853 # PREFIX LOCAL: only hack const_autotool
1854 local extrapath="/usr/sbin:/usr/bin:/sbin:/bin"
1855 @@ -157,7 +176,7 @@ python_prepare_all() {
1856 sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
1857 die "sed failed"
1858 fi
1859 - done < <(find . -type f -print0)
1860 + done < <(find . -type f ! -name etc-update -print0)
1861
1862 einfo "Setting gentoo_prefix as reponame for emerge-webrsync"
1863 sed -i -e 's/repo_name=gentoo/repo_name=gentoo_prefix/' \
1864 @@ -187,7 +206,7 @@ python_prepare_all() {
1865 python_compile_all() {
1866 local targets=()
1867 use doc && targets+=( docbook )
1868 - use epydoc && targets+=( epydoc )
1869 + use apidoc && targets+=( apidoc )
1870
1871 if [[ ${targets[@]} ]]; then
1872 esetup.py "${targets[@]}"
1873 @@ -220,8 +239,8 @@ python_install_all() {
1874 install_docbook
1875 --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
1876 )
1877 - use epydoc && targets+=(
1878 - install_epydoc
1879 + use apidoc && targets+=(
1880 + install_apidoc
1881 --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
1882 )
1883
1884 @@ -230,6 +249,8 @@ python_install_all() {
1885 esetup.py "${targets[@]}"
1886 fi
1887
1888 + systemd_dotmpfilesd "${FILESDIR}"/portage-ccache.conf
1889 +
1890 # Due to distutils/python-exec limitations
1891 # these must be installed to /usr/bin.
1892 local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
1893 @@ -237,28 +258,42 @@ python_install_all() {
1894 dodir /usr/sbin
1895 for target in ${sbin_relocations}; do
1896 einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
1897 - mv "${ED}usr/bin/${target}" "${ED}usr/sbin/${target}" || die "sbin scripts move failed!"
1898 + mv "${ED}/usr/bin/${target}" "${ED}/usr/sbin/${target}" || die "sbin scripts move failed!"
1899 done
1900 }
1901
1902 pkg_preinst() {
1903 - # comment out sanity test until it is fixed to work
1904 - # with the new PORTAGE_PYM_PATH
1905 - #if [[ $ROOT == / ]] ; then
1906 - ## Run some minimal tests as a sanity check.
1907 - #local test_runner=$(find "${ED}" -name runTests)
1908 - #if [[ -n $test_runner && -x $test_runner ]] ; then
1909 - #einfo "Running preinst sanity tests..."
1910 - #"$test_runner" || die "preinst sanity tests failed"
1911 - #fi
1912 - #fi
1913 + python_setup
1914 + local sitedir=$(python_get_sitedir)
1915 + [[ -d ${D}${sitedir} ]] || die "${D}${sitedir}: No such directory"
1916 + env -u DISTDIR \
1917 + -u PORTAGE_OVERRIDE_EPREFIX \
1918 + -u PORTAGE_REPOSITORIES \
1919 + -u PORTDIR \
1920 + -u PORTDIR_OVERLAY \
1921 + PYTHONPATH="${D}${sitedir}${PYTHONPATH:+:${PYTHONPATH}}" \
1922 + "${PYTHON}" -m portage._compat_upgrade.default_locations || die
1923 +
1924 + env -u BINPKG_COMPRESS \
1925 + PYTHONPATH="${D}${sitedir}${PYTHONPATH:+:${PYTHONPATH}}" \
1926 + "${PYTHON}" -m portage._compat_upgrade.binpkg_compression || die
1927
1928 # elog dir must exist to avoid logrotate error for bug #415911.
1929 # This code runs in preinst in order to bypass the mapping of
1930 # portage:portage to root:root which happens after src_install.
1931 keepdir /var/log/portage/elog
1932 # This is allowed to fail if the user/group are invalid for prefix users.
1933 - if chown ${PORTAGE_USER}:${PORTAGE_GROUP} "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
1934 - chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
1935 + if chown ${PORTAGE_USER}:${PORTAGE_GROUP} "${ED}"/var/log/portage{,/elog} 2>/dev/null ; then
1936 + chmod g+s,ug+rwx "${ED}"/var/log/portage{,/elog}
1937 + fi
1938 +
1939 + if has_version "<${CATEGORY}/${PN}-2.3.77"; then
1940 + elog "The emerge --autounmask option is now disabled by default, except for"
1941 + elog "portions of behavior which are controlled by the --autounmask-use and"
1942 + elog "--autounmask-license options. For backward compatibility, previous"
1943 + elog "behavior of --autounmask=y and --autounmask=n is entirely preserved."
1944 + elog "Users can get the old behavior simply by adding --autounmask to the"
1945 + elog "make.conf EMERGE_DEFAULT_OPTS variable. For the rationale for this"
1946 + elog "change, see https://bugs.gentoo.org/658648."
1947 fi
1948 }