Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] bin/ebuild: fix EBUILD_FORCE_TEST / RESTRICT interaction (bug 601466)
Date: Sat, 03 Dec 2016 06:15:05
Message-Id: 1480745259-20197-1-git-send-email-zmedico@gentoo.org
1 Ensure that config adjustments are applied to all relevant
2 config instances, in order to prevent inconsistencies like
3 the one that triggered bug 601466.
4
5 X-Gentoo-Bug: 601466
6 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=601466
7 ---
8 bin/ebuild | 23 ++++++++++++++++-------
9 1 file changed, 16 insertions(+), 7 deletions(-)
10
11 diff --git a/bin/ebuild b/bin/ebuild
12 index 1f99177..e8b8bae 100755
13 --- a/bin/ebuild
14 +++ b/bin/ebuild
15 @@ -244,7 +244,11 @@ if mytree == "porttree" and build_dir_phases.intersection(pargs):
16 ebuild_changed = \
17 portage.portdb._pull_valid_cache(cpv, ebuild, ebuild_portdir)[0] is None
18
19 -tmpsettings = portage.config(clone=portage.settings)
20 +# Make configuration adjustments to portage.portdb.doebuild_settings,
21 +# in order to enforce consistency for EBUILD_FORCE_TEST support
22 +# (see bug 601466).
23 +tmpsettings = portage.portdb.doebuild_settings
24 +
25 tmpsettings["PORTAGE_VERBOSE"] = "1"
26 tmpsettings.backup_changes("PORTAGE_VERBOSE")
27
28 @@ -272,6 +276,17 @@ if "merge" in pargs and "noauto" in tmpsettings.features:
29 print("Disabling noauto in features... merge disables it. (qmerge doesn't)")
30 tmpsettings.features.discard("noauto")
31
32 +if 'digest' in tmpsettings.features:
33 + if pargs and pargs[0] not in ("digest", "manifest"):
34 + pargs = ['digest'] + pargs
35 + # We only need to build digests on the first pass.
36 + tmpsettings.features.discard('digest')
37 +
38 +# Now that configuration adjustments are complete, create a clone of
39 +# tmpsettings. The current instance refers to portdb.doebuild_settings,
40 +# and we want to avoid the possibility of unintended side-effects.
41 +tmpsettings = portage.config(clone=tmpsettings)
42 +
43 try:
44 metadata = dict(zip(Package.metadata_keys,
45 portage.db[portage.settings['EROOT']][mytree].dbapi.aux_get(
46 @@ -315,12 +330,6 @@ def stale_env_warning():
47 open(os.path.join(tmpsettings['PORTAGE_BUILDDIR'],
48 '.ebuild_changed'), 'w').close()
49
50 -if 'digest' in tmpsettings.features:
51 - if pargs and pargs[0] not in ("digest", "manifest"):
52 - pargs = ['digest'] + pargs
53 - # We only need to build digests on the first pass.
54 - tmpsettings.features.discard('digest')
55 -
56 checked_for_stale_env = False
57
58 for arg in pargs:
59 --
60 2.7.4

Replies