Pass along PORTAGE_USERNAME and PORTAGE_GRPNAME since they
authorZac Medico <zmedico@gentoo.org>
Sun, 15 Aug 2010 08:18:19 +0000 (01:18 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 15 Aug 2010 08:18:19 +0000 (01:18 -0700)
need to be inherited by ebuild subprocesses.

pym/portage/tests/ebuild/test_ipc_daemon.py

index f0d072aede7bb985fa63bcb93064c5b0ff687ede..5a5f860fb1e487d5e81c575a33c0c983da19dd8f 100644 (file)
@@ -20,10 +20,19 @@ class IpcDaemonTestCase(TestCase):
                tmpdir = tempfile.mkdtemp()
                try:
                        env = {}
+
+                       # Pass along PORTAGE_USERNAME and PORTAGE_GRPNAME since they
+                       # need to be inherited by ebuild subprocesses.
+                       if 'PORTAGE_USERNAME' in os.environ:
+                               env['PORTAGE_USERNAME'] = os.environ['PORTAGE_USERNAME']
+                       if 'PORTAGE_GRPNAME' in os.environ:
+                               env['PORTAGE_GRPNAME'] = os.environ['PORTAGE_GRPNAME']
+
                        env['PORTAGE_PYTHON'] = sys.executable
                        env['PORTAGE_BIN_PATH'] = PORTAGE_BIN_PATH
                        env['PORTAGE_PYM_PATH'] = PORTAGE_PYM_PATH
                        env['PORTAGE_BUILDDIR'] = tmpdir
+
                        input_fifo = os.path.join(tmpdir, '.ipc_in')
                        output_fifo = os.path.join(tmpdir, '.ipc_out')
                        os.mkfifo(input_fifo)