# Distributed under the terms of the GNU General Public License v2
# $Id$
-from __future__ import print_function
-
__all__ = ['doebuild', 'doebuild_environment', 'spawn', 'spawnebuild']
+import array
import codecs
import errno
+import fcntl
from itertools import chain
import logging
import os as _os
import re
+import select
import shutil
import stat
import sys
+import tempfile
from textwrap import wrap
import time
# so that there's no need for locking and it can be used even if the
# user isn't in the portage group.
if mydo in ("info",):
- from tempfile import mkdtemp
- tmpdir = mkdtemp()
+ tmpdir = tempfile.mkdtemp()
tmpdir_orig = mysettings["PORTAGE_TMPDIR"]
mysettings["PORTAGE_TMPDIR"] = tmpdir
noiselevel=-1)
return 1
else:
- from tempfile import NamedTemporaryFile
- fd = NamedTemporaryFile(prefix="exectest-", dir=checkdir)
+ fd = tempfile.NamedTemporaryFile(prefix="exectest-", dir=checkdir)
os.chmod(fd.name, 0o755)
if not os.access(fd.name, os.X_OK):
writemsg(_("Can not execute files in %s\n"
myebuild=mysettings["EBUILD"], mytree=tree, mydbapi=mydbapi,
vartree=vartree, prev_mtimes=prev_mtimes)
else:
- print(_("!!! Unknown mydo: %s") % mydo)
+ writemsg_stdout(_("!!! Unknown mydo: %s\n") % mydo, noiselevel=-1)
return 1
return retval
# process might have already exited and closed slave_fd so we
# have to keep it open in order to avoid FreeBSD potentially
# generating an EAGAIN exception).
- import fcntl
fcntl.fcntl(master_fd, fcntl.F_SETFL,
fcntl.fcntl(master_fd, fcntl.F_GETFL) | os.O_NONBLOCK)
iwtd = [master_file]
owtd = []
ewtd = []
- import array, select
buffsize = 65536
eof = False
while not eof: