From c9913031f87a7d869e7ce7729616a86b2d3c9bbd Mon Sep 17 00:00:00 2001 From: Mike Khiretskiy Date: Tue, 15 Jul 2014 10:05:29 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0?= =?UTF-8?q?=20=D1=81=D0=BE=D0=BE=D1=82=D0=B2=D0=B5=D1=82=D1=81=D0=B8=D0=B2?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D0=B9?= =?UTF-8?q?=20repo=5Fname=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D1=8B=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update/update.py | 35 ++++++++++++++++------------------- update/variables/update.py | 2 +- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/update/update.py b/update/update.py index eaf030a..0f15ada 100644 --- a/update/update.py +++ b/update/update.py @@ -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(): diff --git a/update/variables/update.py b/update/variables/update.py index f770836..3173c23 100644 --- a/update/variables/update.py +++ b/update/variables/update.py @@ -348,7 +348,7 @@ class VariableClUpdateOtherRepData(ReadonlyTableVariable): self.Get('cl_update_layman_make')) layman_overlays = layman.get_installed() for rpath in self.Get('cl_portdir_overlay'): - repo_file = path.join(rpath,"profiles/repo_name") + repo_file = path.join(rpath, "profiles/repo_name") rname = readFile(repo_file).strip() or path.basename(rpath) if rname in layman_overlays and not rname in repNames: yield (rname, rpath)