1 |
On 7/29/19 5:39 AM, Ulrich Mueller wrote: |
2 |
>>>>>> On Sat, 27 Jul 2019, Michał Górny wrote: |
3 |
> |
4 |
>> While at it, could you look into making src_unpack() network-sandbox |
5 |
>> override apply only to ebuilds with PROPERTIES=live? |
6 |
> |
7 |
> I believe the patch included below would do that. |
8 |
> |
9 |
> Ulrich |
10 |
> |
11 |
> |
12 |
> From f4ebd25a04d5eb64504724b711b41141723afcd4 Mon Sep 17 00:00:00 2001 |
13 |
> From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@g.o> |
14 |
> Date: Mon, 29 Jul 2019 14:22:57 +0200 |
15 |
> Subject: [PATCH] doebuild.py: Override network-sandbox only for live ebuilds. |
16 |
> MIME-Version: 1.0 |
17 |
> Content-Type: text/plain; charset=UTF-8 |
18 |
> Content-Transfer-Encoding: 8bit |
19 |
> |
20 |
> Suggested-by: Michał Górny <mgorny@g.o> |
21 |
> Signed-off-by: Ulrich Müller <ulm@g.o> |
22 |
> --- |
23 |
> lib/portage/package/ebuild/doebuild.py | 3 ++- |
24 |
> 1 file changed, 2 insertions(+), 1 deletion(-) |
25 |
> |
26 |
> diff --git a/lib/portage/package/ebuild/doebuild.py b/lib/portage/package/ebuild/doebuild.py |
27 |
> index 67867d33e..cab838ead 100644 |
28 |
> --- a/lib/portage/package/ebuild/doebuild.py |
29 |
> +++ b/lib/portage/package/ebuild/doebuild.py |
30 |
> @@ -156,7 +156,8 @@ def _doebuild_spawn(phase, settings, actionmap=None, **kwargs): |
31 |
> phase in _ipc_phases |
32 |
> kwargs['mountns'] = 'mount-sandbox' in settings.features |
33 |
> kwargs['networked'] = 'network-sandbox' not in settings.features or \ |
34 |
> - phase in _networked_phases or \ |
35 |
> + (phase in _networked_phases and \ |
36 |
> + 'live' in settings.configdict['pkg'].get('PROPERTIES', '').split()) or \ |
37 |
> 'network-sandbox' in settings['PORTAGE_RESTRICT'].split() |
38 |
> kwargs['pidns'] = ('pid-sandbox' in settings.features and |
39 |
> phase not in _global_pid_phases) |
40 |
> |
41 |
|
42 |
This will enable network-sandbox for all of _networked_phases, but |
43 |
Michał only suggested to do it for src_unpack. |
44 |
-- |
45 |
Thanks, |
46 |
Zac |