|
|
|
@ -116,7 +116,7 @@ class Update:
|
|
|
|
|
raise UpdateError(_("Update is already running. "
|
|
|
|
|
"Try to run later."))
|
|
|
|
|
else:
|
|
|
|
|
self.startTask(_("Waiting for complete another update"))
|
|
|
|
|
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)
|
|
|
|
@ -133,8 +133,8 @@ class Update:
|
|
|
|
|
"cl_update_rep_rev", "cl_update_branch_name"],
|
|
|
|
|
where="cl_update_rep_name", eq=repname, limit=1))
|
|
|
|
|
if not url or not rpath:
|
|
|
|
|
raise UpdateError(_("Variables with repositories settings "
|
|
|
|
|
"is not configured"))
|
|
|
|
|
raise UpdateError(_("Configuration variables for repositories "
|
|
|
|
|
"are not setup"))
|
|
|
|
|
self.addProgress()
|
|
|
|
|
if clean_on_error:
|
|
|
|
|
try:
|
|
|
|
@ -148,7 +148,7 @@ class Update:
|
|
|
|
|
self.printWARNING(str(e))
|
|
|
|
|
self.endTask(False)
|
|
|
|
|
self.startTask(
|
|
|
|
|
_("Re-fetch {name} repository").format(name=repname))
|
|
|
|
|
_("Re-fetching the {name} repository").format(name=repname))
|
|
|
|
|
self.addProgress()
|
|
|
|
|
try:
|
|
|
|
|
rpath_new = "%s_new" % rpath
|
|
|
|
@ -157,7 +157,7 @@ class Update:
|
|
|
|
|
removeDir(rpath)
|
|
|
|
|
os.rename(rpath_new, rpath)
|
|
|
|
|
except OSError:
|
|
|
|
|
raise UpdateError(_("Permission denied to change "
|
|
|
|
|
raise UpdateError(_("Permission denied to modify the "
|
|
|
|
|
"{repname} repository").format(
|
|
|
|
|
repname=repname))
|
|
|
|
|
finally:
|
|
|
|
@ -179,7 +179,7 @@ class Update:
|
|
|
|
|
"""
|
|
|
|
|
layman = getProgPath('/usr/bin/layman')
|
|
|
|
|
if not layman:
|
|
|
|
|
raise UpdateError(_("Layman utility is not found"))
|
|
|
|
|
raise UpdateError(_("The Layman tool is not found"))
|
|
|
|
|
rpath = self.clVars.Select('cl_update_other_rep_path',
|
|
|
|
|
where='cl_update_other_rep_name', eq=repname,
|
|
|
|
|
limit=1)
|
|
|
|
@ -193,7 +193,7 @@ class Update:
|
|
|
|
|
p = process(layman, "-s", repname, stderr=STDOUT)
|
|
|
|
|
if p.failed():
|
|
|
|
|
raise UpdateError(
|
|
|
|
|
_("Failed to update repository {rname}").format(rname=repname),
|
|
|
|
|
_("Failed to update the {rname} repository").format(rname=repname),
|
|
|
|
|
addon=p.read())
|
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
@ -203,12 +203,12 @@ class Update:
|
|
|
|
|
"""
|
|
|
|
|
egenCache = getProgPath('/usr/bin/egencache')
|
|
|
|
|
if not egenCache:
|
|
|
|
|
raise UpdateError(_("Portage utility is not found"))
|
|
|
|
|
raise UpdateError(_("The Portage tool is not found"))
|
|
|
|
|
cpu_num = self.clVars.Get('hr_cpu_num')
|
|
|
|
|
p = process(egenCache, "--repo=%s" % repname, "--update",
|
|
|
|
|
"--jobs=%s" % cpu_num, stderr=STDOUT)
|
|
|
|
|
if p.failed():
|
|
|
|
|
raise UpdateError(_("Failed to update cache of {rname} "
|
|
|
|
|
raise UpdateError(_("Failed to update the cache of the {rname} "
|
|
|
|
|
"repository").format(rname=repname),
|
|
|
|
|
addon=p.read())
|
|
|
|
|
return True
|
|
|
|
@ -219,7 +219,7 @@ class Update:
|
|
|
|
|
"""
|
|
|
|
|
emerge = getProgPath("/usr/bin/emerge")
|
|
|
|
|
if not emerge:
|
|
|
|
|
raise UpdateError(_("Emerge utility is not found"))
|
|
|
|
|
raise UpdateError(_("The Emerge tool is not found"))
|
|
|
|
|
self.addProgress()
|
|
|
|
|
p = PercentProgress(emerge, "--metadata", part=1, atty=True)
|
|
|
|
|
for perc in p.progress():
|
|
|
|
@ -238,7 +238,7 @@ class Update:
|
|
|
|
|
"""
|
|
|
|
|
eixupdate = getProgPath("/usr/bin/eix-update")
|
|
|
|
|
if not eixupdate:
|
|
|
|
|
raise UpdateError(_("Eix utility is not found"))
|
|
|
|
|
raise UpdateError(_("The Eix tool is not found"))
|
|
|
|
|
self.addProgress()
|
|
|
|
|
excludeList = []
|
|
|
|
|
if self.clVars.Get('cl_update_eixupdate_force') == 'force':
|
|
|
|
@ -337,7 +337,7 @@ class Update:
|
|
|
|
|
"""
|
|
|
|
|
cmd_path = getProgPath(cmd)
|
|
|
|
|
if not cmd_path:
|
|
|
|
|
raise UpdateError(_("Failed to find %s command") % cmd)
|
|
|
|
|
raise UpdateError(_("Failed to find the %s command") % cmd)
|
|
|
|
|
with EmergeParser(
|
|
|
|
|
emerge_parser.CommandExecutor(cmd_path, params)) as emerge:
|
|
|
|
|
self._startEmerging(emerge)
|
|
|
|
@ -349,7 +349,7 @@ class Update:
|
|
|
|
|
"""
|
|
|
|
|
cmd_path = getProgPath(cmd)
|
|
|
|
|
if not cmd_path:
|
|
|
|
|
raise UpdateError(_("Failed to find %s command") % cmd)
|
|
|
|
|
raise UpdateError(_("Failed to find the %s command") % cmd)
|
|
|
|
|
with EmergeParser(
|
|
|
|
|
emerge_parser.CommandExecutor(cmd_path, params)) as emerge:
|
|
|
|
|
revdep = RevdepPercentBlock(emerge)
|
|
|
|
@ -409,7 +409,7 @@ class Update:
|
|
|
|
|
self._display_pretty_package_list(pkglist)
|
|
|
|
|
if emerge.install_packages.remove_list:
|
|
|
|
|
self.printSUCCESS(_print(
|
|
|
|
|
_("List removal packages")))
|
|
|
|
|
_("Listing packages for removal")))
|
|
|
|
|
self._display_pretty_package_list(
|
|
|
|
|
emerge.install_packages.remove_list, remove_list=True)
|
|
|
|
|
if str(emerge.download_size) != "0 kB":
|
|
|
|
@ -427,7 +427,7 @@ class Update:
|
|
|
|
|
_print = self.color_print
|
|
|
|
|
pkglist = emerge.uninstall_packages.list
|
|
|
|
|
self.printSUCCESS(_print.bold(
|
|
|
|
|
_("List removal packages")))
|
|
|
|
|
_("Listing packages for removal")))
|
|
|
|
|
self._display_pretty_package_list(pkglist, remove_list=True)
|
|
|
|
|
|
|
|
|
|
def getCacheOnWorld(self, params, packages, check=False):
|
|
|
|
|