summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/package/ebuild/doebuild.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index 184dc46dc..e316c808b 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -2,19 +2,21 @@
# 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
@@ -523,8 +525,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
# 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
@@ -620,8 +621,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
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"
@@ -1002,7 +1002,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
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
@@ -1188,7 +1188,6 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
# 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)
@@ -1248,7 +1247,6 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
iwtd = [master_file]
owtd = []
ewtd = []
- import array, select
buffsize = 65536
eof = False
while not eof: