|
|
@ -25,7 +25,7 @@ import json
|
|
|
|
from calculate.core.server.gen_pid import search_worked_process2
|
|
|
|
from calculate.core.server.gen_pid import search_worked_process2
|
|
|
|
from calculate.core.setup_package import ChainProgressTemplate
|
|
|
|
from calculate.core.setup_package import ChainProgressTemplate
|
|
|
|
from calculate.lib.cl_template import templateFunction, SystemIni
|
|
|
|
from calculate.lib.cl_template import templateFunction, SystemIni
|
|
|
|
from calculate.lib.datavars import DataVars, Variable
|
|
|
|
from calculate.lib.datavars import DataVars, Variable, DataVarsError
|
|
|
|
from calculate.lib.utils.colortext import (TextState, get_color_print)
|
|
|
|
from calculate.lib.utils.colortext import (TextState, get_color_print)
|
|
|
|
from calculate.lib.utils.common import CmdlineParams, getTupleVersion
|
|
|
|
from calculate.lib.utils.common import CmdlineParams, getTupleVersion
|
|
|
|
from calculate.lib.utils.portage import (BinaryPackage, get_binary_file,
|
|
|
|
from calculate.lib.utils.portage import (BinaryPackage, get_binary_file,
|
|
|
@ -60,7 +60,7 @@ from calculate.update.emerge_parser import (EmergeParser,
|
|
|
|
from calculate.lib.cl_log import log
|
|
|
|
from calculate.lib.cl_log import log
|
|
|
|
from calculate.update.update_tasks import EmergeMark
|
|
|
|
from calculate.update.update_tasks import EmergeMark
|
|
|
|
from .build_storage import Build
|
|
|
|
from .build_storage import Build
|
|
|
|
from calculate.update.update import Update
|
|
|
|
from calculate.update.update import Update, variable_module
|
|
|
|
from calculate.install.distr import (Distributive, IsoDistributive,
|
|
|
|
from calculate.install.distr import (Distributive, IsoDistributive,
|
|
|
|
DistributiveError, ContainerDistributive)
|
|
|
|
DistributiveError, ContainerDistributive)
|
|
|
|
import shutil
|
|
|
|
import shutil
|
|
|
@ -102,6 +102,7 @@ class Builder(Update):
|
|
|
|
self.pkgnum = None
|
|
|
|
self.pkgnum = None
|
|
|
|
self.pkgnummax = None
|
|
|
|
self.pkgnummax = None
|
|
|
|
self.world_data = ""
|
|
|
|
self.world_data = ""
|
|
|
|
|
|
|
|
self.binhosts_data = None
|
|
|
|
|
|
|
|
|
|
|
|
def mount_target(self, target):
|
|
|
|
def mount_target(self, target):
|
|
|
|
dir_distro = target.convertToDirectory()
|
|
|
|
dir_distro = target.convertToDirectory()
|
|
|
@ -593,6 +594,10 @@ class Builder(Update):
|
|
|
|
with self.clVars.useDefaultModule("update"):
|
|
|
|
with self.clVars.useDefaultModule("update"):
|
|
|
|
return super(Builder, self).regenCache(repname)
|
|
|
|
return super(Builder, self).regenCache(repname)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def prepare_gpg(self):
|
|
|
|
|
|
|
|
with self.clVars.useDefaultModule("update"):
|
|
|
|
|
|
|
|
return super(Builder, self).prepare_gpg()
|
|
|
|
|
|
|
|
|
|
|
|
def getGit(self):
|
|
|
|
def getGit(self):
|
|
|
|
chroot_path = self.clVars.Get('builder.cl_builder_path')
|
|
|
|
chroot_path = self.clVars.Get('builder.cl_builder_path')
|
|
|
|
sshkey = pathJoin(chroot_path,
|
|
|
|
sshkey = pathJoin(chroot_path,
|
|
|
@ -624,6 +629,7 @@ class Builder(Update):
|
|
|
|
makeDirectory(logpath)
|
|
|
|
makeDirectory(logpath)
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@variable_module("builder")
|
|
|
|
def _get_log_file(self):
|
|
|
|
def _get_log_file(self):
|
|
|
|
logname = "build-%s/%s" % (self.clVars.Get('cl_builder_id_path'),
|
|
|
|
logname = "build-%s/%s" % (self.clVars.Get('cl_builder_id_path'),
|
|
|
|
self.clVars.Get('cl_task_name'))
|
|
|
|
self.clVars.Get('cl_task_name'))
|
|
|
@ -1107,12 +1113,13 @@ class Builder(Update):
|
|
|
|
self._startEmerging(emerge)
|
|
|
|
self._startEmerging(emerge)
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
def update_layman(self, builder_path):
|
|
|
|
def update_layman(self):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Обновить базу layman
|
|
|
|
Обновить базу layman
|
|
|
|
:param builder_path:
|
|
|
|
:param builder_path:
|
|
|
|
:return:
|
|
|
|
:return:
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
builder_path = self.clVars.Get("cl_builder_path")
|
|
|
|
cmd = "/usr/bin/layman"
|
|
|
|
cmd = "/usr/bin/layman"
|
|
|
|
cmd_path = self.get_prog_path(cmd)
|
|
|
|
cmd_path = self.get_prog_path(cmd)
|
|
|
|
logfile = self._get_log_file()
|
|
|
|
logfile = self._get_log_file()
|
|
|
@ -1310,23 +1317,57 @@ class Builder(Update):
|
|
|
|
raise BuilderError(str(e))
|
|
|
|
raise BuilderError(str(e))
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
def raiseOutdate(self):
|
|
|
|
def prepare_update_vars(self):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Установить флаг данные о репозиториях устарели (необходим для выполнения
|
|
|
|
Заместить значения update переменных одноимёнными из builder
|
|
|
|
eix-update и прочих команд обновляющих кэш
|
|
|
|
|
|
|
|
:return:
|
|
|
|
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
self.clVars.Set('cl_builder_outdate_set', 'on', force=True)
|
|
|
|
vars_map = {
|
|
|
|
|
|
|
|
#Применить значение переменной для выбора веток репозиториев
|
|
|
|
|
|
|
|
#при обновлении
|
|
|
|
|
|
|
|
'update.cl_update_branch_name': 'builder.cl_builder_branch_name',
|
|
|
|
|
|
|
|
|
|
|
|
def apply_branch_variables(self):
|
|
|
|
'update.cl_update_gpg_force': 'builder.cl_builder_gpg_force',
|
|
|
|
"""
|
|
|
|
'update.cl_update_gpg_keys': 'builder.cl_builder_gpg_keys',
|
|
|
|
Применить значение переменной для выбора веток репозиториев
|
|
|
|
'update.cl_update_binhost_revision_path':
|
|
|
|
при обновлении
|
|
|
|
'builder.cl_builder_binhost_revision_path',
|
|
|
|
"""
|
|
|
|
'update.cl_update_binhost_timestamp_path':
|
|
|
|
self.clVars.Set('update.cl_update_branch_name',
|
|
|
|
'builder.cl_builder_binhost_timestamp_path',
|
|
|
|
self.clVars.Get('builder.cl_builder_branch_name'))
|
|
|
|
'update.cl_update_last_timestamp':
|
|
|
|
|
|
|
|
'builder.cl_builder_last_timestamp',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'update.cl_update_binhost_stable_set':
|
|
|
|
|
|
|
|
'builder.cl_builder_binhost_stable_set',
|
|
|
|
|
|
|
|
'update.cl_update_binhost_stable_opt_set':
|
|
|
|
|
|
|
|
'builder.cl_builder_binhost_stable_opt_set',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'update.cl_update_binhost':
|
|
|
|
|
|
|
|
'builder.cl_builder_binhost',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'update.cl_update_sync_rep': 'builder.cl_builder_sync_rep',
|
|
|
|
|
|
|
|
'update.cl_update_other_rep_name': 'builder.cl_builder_other_rep_name',
|
|
|
|
|
|
|
|
'update.cl_update_usetag_set': 'builder.cl_builder_usetag_set',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'update.cl_update_sync_overlay_rep': 'builder.cl_builder_sync_overlay_rep',
|
|
|
|
|
|
|
|
'update.cl_repository_name': 'builder.cl_builder_repository_name'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
for k,v in vars_map.items():
|
|
|
|
|
|
|
|
self.clVars.Set(k, self.clVars.Get(v), force=True)
|
|
|
|
|
|
|
|
except DataVarsError as e:
|
|
|
|
|
|
|
|
error = BuilderError(_("Failed to prepare variables for synchronization"))
|
|
|
|
|
|
|
|
error.addon = e
|
|
|
|
|
|
|
|
raise error
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@variable_module("builder")
|
|
|
|
|
|
|
|
def _get_binhost_logger(self):
|
|
|
|
|
|
|
|
logname = "build-%s/%s" % (self.clVars.Get('cl_builder_id_path'),
|
|
|
|
|
|
|
|
"binhost-scan.log")
|
|
|
|
|
|
|
|
mainlog = self.clVars.Get('core.cl_log_path')
|
|
|
|
|
|
|
|
return log("binhost-scan.log",
|
|
|
|
|
|
|
|
filename=path.join(mainlog, logname),
|
|
|
|
|
|
|
|
formatter="%(message)s")
|
|
|
|
|
|
|
|
|
|
|
|
def isohybrid(self, image_file):
|
|
|
|
def isohybrid(self, image_file):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Преобразовать ISO образ в гибридный
|
|
|
|
Преобразовать ISO образ в гибридный
|
|
|
@ -1390,6 +1431,9 @@ class Builder(Update):
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_arch_machine(self):
|
|
|
|
|
|
|
|
return self.clVars.Get("builder.os_builder_arch_machine")
|
|
|
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
@property
|
|
|
|
def chroot_process(self):
|
|
|
|
def chroot_process(self):
|
|
|
|
chroot_cmd = getProgPath("/usr/bin/chroot")
|
|
|
|
chroot_cmd = getProgPath("/usr/bin/chroot")
|
|
|
@ -2033,6 +2077,8 @@ class Builder(Update):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
self.clVars.Write('cl_update_binhost', binhost)
|
|
|
|
self.clVars.Write('cl_update_binhost', binhost)
|
|
|
|
self.clVars.Set('cl_update_package_cache_set', 'on')
|
|
|
|
self.clVars.Set('cl_update_package_cache_set', 'on')
|
|
|
|
|
|
|
|
self.clVars.Set('cl_update_binhost_list', [binhost], force=True)
|
|
|
|
|
|
|
|
self.clVars.Set('cl_update_binhost_unstable_list', [binhost], force=True)
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
def index_pkgdir(self, pkgdir, trunkdir, stabledir):
|
|
|
|
def index_pkgdir(self, pkgdir, trunkdir, stabledir):
|
|
|
@ -2083,3 +2129,13 @@ class Builder(Update):
|
|
|
|
raise BuilderError(
|
|
|
|
raise BuilderError(
|
|
|
|
_("Failed to merge prepared binaries: %s") % str(e))
|
|
|
|
_("Failed to merge prepared binaries: %s") % str(e))
|
|
|
|
return True
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@variable_module("builder")
|
|
|
|
|
|
|
|
def update_binhost_list(self):
|
|
|
|
|
|
|
|
self.invalidateVariables('cl_builder_linux_datavars')
|
|
|
|
|
|
|
|
self.prepare_update_vars()
|
|
|
|
|
|
|
|
return super(Builder,self).update_binhost_list(
|
|
|
|
|
|
|
|
self.clVars.Get('cl_builder_linux_datavars'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def is_update_action(self, action):
|
|
|
|
|
|
|
|
return action == Actions.Update
|
|
|
|