|
|
|
@ -35,7 +35,8 @@ from package_tools import Git, Layman,\
|
|
|
|
|
|
|
|
|
|
Colors = TextState.Colors
|
|
|
|
|
from calculate.lib.utils.files import (getProgPath, STDOUT, removeDir,
|
|
|
|
|
PercentProgress, process, getRunCommands)
|
|
|
|
|
PercentProgress, process, getRunCommands,
|
|
|
|
|
readFile)
|
|
|
|
|
from calculate.lib.cl_lang import (setLocalTranslate, getLazyLocalTranslate,
|
|
|
|
|
RegexpLocalization, _)
|
|
|
|
|
import emerge_parser
|
|
|
|
@ -227,6 +228,18 @@ class Update:
|
|
|
|
|
egenCache = getProgPath('/usr/bin/egencache')
|
|
|
|
|
if not egenCache:
|
|
|
|
|
raise UpdateError(_("The Portage tool is not found"))
|
|
|
|
|
path_rep = self.clVars.Select('cl_update_rep_path',
|
|
|
|
|
where='cl_update_rep_name',
|
|
|
|
|
eq=repname, limit=1)
|
|
|
|
|
repo_name = readFile(
|
|
|
|
|
path.join(path_rep,"profiles/repo_name")).strip()
|
|
|
|
|
if repo_name != repname:
|
|
|
|
|
self.printWARNING(
|
|
|
|
|
_("Repository '{repo_name}' called '{repname}'"
|
|
|
|
|
" in cl_update_rep_name").format(
|
|
|
|
|
repo_name=repo_name, repname=repname))
|
|
|
|
|
raise UpdateError(_("Failed to update the cache of the {rname} "
|
|
|
|
|
"repository").format(rname=repname))
|
|
|
|
|
cpu_num = self.clVars.Get('hr_cpu_num')
|
|
|
|
|
p = process(egenCache, "--repo=%s" % repname, "--update",
|
|
|
|
|
"--jobs=%s" % cpu_num, stderr=STDOUT)
|
|
|
|
@ -267,24 +280,8 @@ class Update:
|
|
|
|
|
if not eixupdate:
|
|
|
|
|
raise UpdateError(_("The Eix tool is not found"))
|
|
|
|
|
self.addProgress()
|
|
|
|
|
excludeList = []
|
|
|
|
|
if self.clVars.Get('cl_update_eixupdate_force') == 'force':
|
|
|
|
|
countRep = len(self.clVars.Get('cl_update_rep_name'))
|
|
|
|
|
else:
|
|
|
|
|
for rep in self.clVars.Get('cl_update_rep_name'):
|
|
|
|
|
# подстановка имен
|
|
|
|
|
mapNames = {'portage': 'gentoo'}
|
|
|
|
|
if not rep in self.clVars.Get('cl_update_sync_rep'):
|
|
|
|
|
excludeList.extend(["-x", mapNames.get(rep, rep)])
|
|
|
|
|
countRep = len(self.clVars.Get('cl_update_sync_rep'))
|
|
|
|
|
if (self.clVars.Get('cl_update_other_set') == 'on' or
|
|
|
|
|
self.clVars.Get('cl_update_eixupdate_force') == 'force'):
|
|
|
|
|
countRep += len(self.clVars.Get('update.cl_update_other_rep_name'))
|
|
|
|
|
else:
|
|
|
|
|
for rep in self.clVars.Get('update.cl_update_other_rep_name'):
|
|
|
|
|
excludeList.extend(['-x', rep])
|
|
|
|
|
p = PercentProgress(eixupdate, "-F", *excludeList, part=countRep or 1,
|
|
|
|
|
atty=True)
|
|
|
|
|
countRep = len(self.clVars.Get('main.cl_portdir_overlay'))+1
|
|
|
|
|
p = PercentProgress(eixupdate, "-F", part=countRep or 1, atty=True)
|
|
|
|
|
for perc in p.progress():
|
|
|
|
|
self.setProgress(perc)
|
|
|
|
|
if p.failed():
|
|
|
|
|