commit:     16155aaa9b09112a7a49d0c833b19be3399e746a
Author:     Yuta SATOH <nigoro.dev <AT> gmail <DOT> com>
AuthorDate: Fri Dec 29 01:02:02 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Dec 29 02:01:27 2017 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=16155aaa

main.py: Disable snakeoil's namespace module on Gentoo/FreeBSD #363557

Some code improvement by: Patrice Clement <monsieurp <AT> gentoo.org>
Bug url: https://bugs.gentoo.org/363577

 catalyst/main.py | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/catalyst/main.py b/catalyst/main.py
index 4c55a415..2d2faada 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -430,13 +430,16 @@ def _main(parser, opts):
                # catalyst cannot be run as a normal user due to chroots, 
mounts, etc
                log.critical('This script requires root privileges to operate')
 
-       # Start off by creating unique namespaces to run in.  Would be nice to
-       # use pid & user namespaces, but snakeoil's namespace module has signal
-       # transfer issues (CTRL+C doesn't propagate), and user namespaces need
-       # more work due to Gentoo build process (uses sudo/root/portage).
-       namespaces.simple_unshare(
-               mount=True, uts=True, ipc=True, pid=False, net=False, 
user=False,
-               hostname='catalyst')
+       # Namespaces aren't supported on *BSDs at the moment. So let's check
+       # whether we're on Linux.
+       if os.uname().sysname in  ["Linux", "linux"]:
+               # Start off by creating unique namespaces to run in.  Would be 
nice to
+               # use pid & user namespaces, but snakeoil's namespace module 
has signal
+               # transfer issues (CTRL+C doesn't propagate), and user 
namespaces need
+               # more work due to Gentoo build process (uses 
sudo/root/portage).
+               namespaces.simple_unshare(
+                       mount=True, uts=True, ipc=True, pid=False, net=False, 
user=False,
+                       hostname='catalyst')
 
        # everything is setup, so the build is a go
        try:

Reply via email to