|
|
|
@ -14,17 +14,19 @@
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
from itertools import ifilter
|
|
|
|
|
import random
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
from os import path
|
|
|
|
|
import os
|
|
|
|
|
import time
|
|
|
|
|
from calculate.core.server.gen_pid import search_worked_process
|
|
|
|
|
from calculate.core.server.gen_pid import search_worked_process, ProcessStatus
|
|
|
|
|
|
|
|
|
|
from calculate.lib.utils.tools import AddonError
|
|
|
|
|
from calculate.lib.utils.colortext.palette import TextState
|
|
|
|
|
from calculate.lib.utils.colortext import get_color_print
|
|
|
|
|
from calculate.update.emerge_parser import RevdepPercentBlock
|
|
|
|
|
import math
|
|
|
|
|
|
|
|
|
|
from package_tools import Git, Layman,\
|
|
|
|
|
EmergeLogNamedTask, EmergeLog, GitError, \
|
|
|
|
@ -120,9 +122,16 @@ class Update:
|
|
|
|
|
"Try to run later."))
|
|
|
|
|
else:
|
|
|
|
|
self.startTask(_("Waiting for another update to be complete"))
|
|
|
|
|
while any(ifilter(lambda x: os.getpid() != x,
|
|
|
|
|
search_worked_process('update', dv))):
|
|
|
|
|
time.sleep(0.3)
|
|
|
|
|
|
|
|
|
|
while filter(lambda x: os.getpid() != x,
|
|
|
|
|
search_worked_process('update', dv)):
|
|
|
|
|
self.pauseProcess()
|
|
|
|
|
while any(ifilter(lambda x: os.getpid() != x,
|
|
|
|
|
search_worked_process('update', dv))):
|
|
|
|
|
time.sleep(0.3)
|
|
|
|
|
self.resumeProcess()
|
|
|
|
|
time.sleep(random.random()*3)
|
|
|
|
|
|
|
|
|
|
self.endTask()
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|