1 |
Signed-off-by: Michał Górny <mgorny@g.o> |
2 |
--- |
3 |
bin/ebuild.sh | 13 +++++++------ |
4 |
lib/_emerge/EbuildMetadataPhase.py | 15 +++++++++------ |
5 |
2 files changed, 16 insertions(+), 12 deletions(-) |
6 |
|
7 |
diff --git a/bin/ebuild.sh b/bin/ebuild.sh |
8 |
index 32995d95b..381bcb5c8 100755 |
9 |
--- a/bin/ebuild.sh |
10 |
+++ b/bin/ebuild.sh |
11 |
@@ -754,10 +754,11 @@ if [[ $EBUILD_PHASE = depend ]] ; then |
12 |
export SANDBOX_ON="0" |
13 |
set -f |
14 |
|
15 |
- auxdbkeys="DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE |
16 |
+ metadata_keys=( |
17 |
+ DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE |
18 |
DESCRIPTION KEYWORDS INHERITED IUSE REQUIRED_USE PDEPEND BDEPEND |
19 |
- EAPI PROPERTIES DEFINED_PHASES IDEPEND UNUSED_04 |
20 |
- UNUSED_03 UNUSED_02 UNUSED_01" |
21 |
+ EAPI PROPERTIES DEFINED_PHASES IDEPEND |
22 |
+ ) |
23 |
|
24 |
if ! ___eapi_has_BDEPEND; then |
25 |
unset BDEPEND |
26 |
@@ -767,10 +768,10 @@ if [[ $EBUILD_PHASE = depend ]] ; then |
27 |
fi |
28 |
|
29 |
# The extra $(echo) commands remove newlines. |
30 |
- for f in ${auxdbkeys} ; do |
31 |
- eval "echo \$(echo \${!f}) 1>&${PORTAGE_PIPE_FD}" || exit $? |
32 |
+ for f in "${metadata_keys[@]}" ; do |
33 |
+ echo "${f}=$(echo ${!f})" >&${PORTAGE_PIPE_FD} || exit $? |
34 |
done |
35 |
- eval "exec ${PORTAGE_PIPE_FD}>&-" |
36 |
+ exec {PORTAGE_PIPE_FD}>&- |
37 |
set +f |
38 |
else |
39 |
# Note: readonly variables interfere with __preprocess_ebuild_env(), so |
40 |
diff --git a/lib/_emerge/EbuildMetadataPhase.py b/lib/_emerge/EbuildMetadataPhase.py |
41 |
index d00f194c2..5fd0e8a4d 100644 |
42 |
--- a/lib/_emerge/EbuildMetadataPhase.py |
43 |
+++ b/lib/_emerge/EbuildMetadataPhase.py |
44 |
@@ -151,13 +151,16 @@ class EbuildMetadataPhase(SubProcess): |
45 |
metadata_lines = _unicode_decode(b''.join(self._raw_metadata), |
46 |
encoding=_encodings['repo.content'], |
47 |
errors='replace').splitlines() |
48 |
+ metadata = {} |
49 |
metadata_valid = True |
50 |
- if len(portage.auxdbkeys) != len(metadata_lines): |
51 |
- # Don't trust bash's returncode if the |
52 |
- # number of lines is incorrect. |
53 |
- metadata_valid = False |
54 |
- else: |
55 |
- metadata = dict(zip(portage.auxdbkeys, metadata_lines)) |
56 |
+ for l in metadata_lines: |
57 |
+ if '=' not in l: |
58 |
+ metadata_valid = False |
59 |
+ break |
60 |
+ key, value = l.split('=', 1) |
61 |
+ metadata[key] = value |
62 |
+ |
63 |
+ if metadata_valid: |
64 |
parsed_eapi = self._eapi |
65 |
if parsed_eapi is None: |
66 |
parsed_eapi = "0" |
67 |
-- |
68 |
2.33.0 |