Исправлено определение запущенного emerge

legacy27 3.6.7.7
parent 62dd0d255b
commit 7fd17fd332

@ -55,6 +55,7 @@ from calculate.lib.utils.text import _u8, _u
Colors = TextState.Colors Colors = TextState.Colors
from calculate.lib.utils.files import (getProgPath, STDOUT, removeDir, from calculate.lib.utils.files import (getProgPath, STDOUT, removeDir,
getParentPids,
PercentProgress, process, getRunCommands, PercentProgress, process, getRunCommands,
readFile, listDirectory, pathJoin, readFile, listDirectory, pathJoin,
find, FindFileType,quite_unlink, find, FindFileType,quite_unlink,
@ -318,8 +319,11 @@ class Update(MethodsInterface):
self.endTask() self.endTask()
if self.clVars.Get('cl_chroot_status') == 'off': if self.clVars.Get('cl_chroot_status') == 'off':
emerge_running = lambda: any(fnmatch(x, "*python-exec/*/emerge*") parents_pids = set(getParentPids(os.getpid()))
for x in getRunCommands(True)) emerge_running = lambda : (
any((fnmatch(x[1], "*python-exec/*/emerge*") and
x[0] not in parents_pids)
for x in getRunCommands(True, withpid=True)))
if emerge_running(): if emerge_running():
if not wait_update: if not wait_update:
raise UpdateError(_("Emerge is running. " raise UpdateError(_("Emerge is running. "

Loading…
Cancel
Save