Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 206773 | Differences between
and this patch

Collapse All | Expand All

(-)pym/portage/__init__.py (-1 / +2 lines)
Lines 996-1002 Link Here
996
		"PORTAGE_ELOG_MAILURI", "PORTAGE_ELOG_SYSTEM",
996
		"PORTAGE_ELOG_MAILURI", "PORTAGE_ELOG_SYSTEM",
997
		"PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS", "PORTAGE_FETCH_RESUME_MIN_SIZE",
997
		"PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS", "PORTAGE_FETCH_RESUME_MIN_SIZE",
998
		"PORTAGE_GPG_DIR",
998
		"PORTAGE_GPG_DIR",
999
		"PORTAGE_GPG_KEY", "PORTAGE_PACKAGE_EMPTY_ABORT",
999
		"PORTAGE_GPG_KEY", "PORTAGE_IONICE_COMMAND",
1000
		"PORTAGE_PACKAGE_EMPTY_ABORT",
1000
		"PORTAGE_RO_DISTDIRS",
1001
		"PORTAGE_RO_DISTDIRS",
1001
		"PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS",
1002
		"PORTAGE_RSYNC_EXTRA_OPTS", "PORTAGE_RSYNC_OPTS",
1002
		"PORTAGE_RSYNC_RETRIES", "PORTAGE_USE", "PORT_LOGDIR",
1003
		"PORTAGE_RSYNC_RETRIES", "PORTAGE_USE", "PORT_LOGDIR",
(-)pym/_emerge/__init__.py (+25 lines)
Lines 12846-12851 Link Here
12846
		settings["NOCOLOR"] = "true"
12846
		settings["NOCOLOR"] = "true"
12847
		settings.backup_changes("NOCOLOR")
12847
		settings.backup_changes("NOCOLOR")
12848
12848
12849
def ionice(settings):
12850
12851
	ionice_cmd = settings.get("PORTAGE_IONICE_COMMAND")
12852
	if ionice_cmd:
12853
		ionice_cmd = shlex.split(ionice_cmd)
12854
	if not ionice_cmd:
12855
		return
12856
12857
	from portage.util import varexpand
12858
	variables = {"PID" : str(os.getpid())}
12859
	cmd = [varexpand(x, mydict=variables) for x in ionice_cmd]
12860
12861
	try:
12862
		rval = portage.process.spawn(cmd, env=os.environ)
12863
	except portage.exception.CommandNotFound:
12864
		# The OS kernel probably doesn't support ionice,
12865
		# so return silently.
12866
		return
12867
12868
	if rval != os.EX_OK:
12869
		out = portage.output.EOutput()
12870
		out.eerror("PORTAGE_IONICE_COMMAND returned %d" % (rval,))
12871
12849
def emerge_main():
12872
def emerge_main():
12850
	global portage	# NFC why this is necessary now - genone
12873
	global portage	# NFC why this is necessary now - genone
12851
	portage._disable_legacy_globals()
12874
	portage._disable_legacy_globals()
Lines 12867-12872 Link Here
12867
	settings, trees, mtimedb = load_emerge_config()
12890
	settings, trees, mtimedb = load_emerge_config()
12868
	portdb = trees[settings["ROOT"]]["porttree"].dbapi
12891
	portdb = trees[settings["ROOT"]]["porttree"].dbapi
12869
12892
12893
	ionice(settings)
12894
12870
	try:
12895
	try:
12871
		os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
12896
		os.nice(int(settings.get("PORTAGE_NICENESS", "0")))
12872
	except (OSError, ValueError), e:
12897
	except (OSError, ValueError), e:
(-)cnf/make.globals (+3 lines)
Lines 62-67 Link Here
62
# Minimum size of existing file for RESUMECOMMAND to be called.
62
# Minimum size of existing file for RESUMECOMMAND to be called.
63
PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
63
PORTAGE_FETCH_RESUME_MIN_SIZE="350K"
64
64
65
# Command called to adjust the io priority of portage and it's subprocesses.
66
PORTAGE_IONICE_COMMAND="ionice -c 2 -n 7 -p \${PID}"
67
65
# Number of times 'emerge --sync' will run before giving up.
68
# Number of times 'emerge --sync' will run before giving up.
66
PORTAGE_RSYNC_RETRIES="3"
69
PORTAGE_RSYNC_RETRIES="3"
67
70
(-)man/make.conf.5 (+8 lines)
Lines 459-464 Link Here
459
variable should contain an integer number of bytes and may have a suffix such
459
variable should contain an integer number of bytes and may have a suffix such
460
as K, M, or G.
460
as K, M, or G.
461
.TP
461
.TP
462
\fBPORTAGE_IONICE_COMMAND\fR = \fI[ionice command string]\fR
463
This variable should contain a command for portage to call in order
464
to adjust the io priority of portage and it's subprocesses. The command
465
string should contain a \\${PID} place-holder that will be substituted
466
with an integer pid. For more information about ionice, see \fBionice\fR(1).
467
.br
468
Defaults to "ionice -c 2 -n 7 -p \\${PID}".
469
.TP
462
\fBPORTAGE_NICENESS\fR = \fI[number]\fR
470
\fBPORTAGE_NICENESS\fR = \fI[number]\fR
463
The value of this variable will be added to the current nice level that
471
The value of this variable will be added to the current nice level that
464
emerge is running at.  In other words, this will not set the nice level,
472
emerge is running at.  In other words, this will not set the nice level,

Return to bug 206773