ebuild: allow RESTRICT=network-sandbox in ebuilds

Some ebuilds are a bit hard to fix their use of the network in src
phases, so allow them to disable things.  This allows us to turn off
access by default and for the vast majority while we work out how to
fix the few broken packages.

Hopefully we can back this out once all the ebuilds have been updated.

TEST=building an ebuild with RESTRICT=network-sandbox allows network access still

Change-Id: Ibc0430a990b0f6dc728967f3a3414d28263bf397
Reviewed-on: https://chromium-review.googlesource.com/538235
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 98e5903..8c314c1 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -129,7 +129,8 @@
 	kwargs['ipc'] = 'ipc-sandbox' not in settings.features or \
 		phase in _ipc_phases
 	kwargs['networked'] = 'network-sandbox' not in settings.features or \
-		phase in _networked_phases
+		phase in _networked_phases or \
+		'network-sandbox' in settings['PORTAGE_RESTRICT'].split()
 	if phase == 'depend':
 		kwargs['droppriv'] = 'userpriv' in settings.features