if not ebuildpath or not os.path.exists(ebuildpath):
out.ewarn("No ebuild found for '%s'" % pkg)
continue
- # In some cases the above print statements don't flush stdout, so
- # it needs to be flushed before allowing a child process to use it
- # so that output always shows in the correct order.
- sys.stdout.flush()
portage.doebuild(ebuildpath, "info", pkgsettings["ROOT"],
pkgsettings, debug=(settings.get("PORTAGE_DEBUG", "") == 1),
mydbapi=trees[settings["ROOT"]]["vartree"].dbapi,
env=mysettings.environ()
keywords["opt_name"]="[%s]" % mysettings["PF"]
+ # In some cases the above print statements don't flush stdout, so
+ # it needs to be flushed before allowing a child process to use it
+ # so that output always shows in the correct order.
+ fd_pipes = keywords.get("fd_pipes")
+ if fd_pipes:
+ if fd_pipes.get(1) == sys.stdout.fileno():
+ sys.stdout.flush()
+ if fd_pipes.get(2) == sys.stderr.fileno():
+ sys.stderr.flush()
+
# The default policy for the sesandbox domain only allows entry (via exec)
# from shells and from binaries that belong to portage (the number of entry
# points is minimized). The "tee" binary is not among the allowed entry