|
|
|
@ -32,6 +32,7 @@ from calculate.update.profile import RepositoryStorageSet, DEFAULT_BRANCH
|
|
|
|
|
|
|
|
|
|
from calculate.lib.variables.linux import VariableOsLinuxName, \
|
|
|
|
|
VariableOsLinuxSubname, VariableOsLinuxVer, VariableOsLinuxShortname
|
|
|
|
|
from calculate.lib.variables.env import VariableClTemplateLocation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setLocalTranslate('cl_update3', sys.modules[__name__])
|
|
|
|
@ -49,11 +50,23 @@ class VariableAcUpdateSync(ReadonlyVariable):
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateWorld(Variable):
|
|
|
|
|
def get(self):
|
|
|
|
|
if self.Get('cl_rebuild_world_set') == "on":
|
|
|
|
|
return "rebuild"
|
|
|
|
|
else:
|
|
|
|
|
return ""
|
|
|
|
|
type = "choice"
|
|
|
|
|
value = "update"
|
|
|
|
|
opt = ["--world"]
|
|
|
|
|
syntax = "--{choice}-world"
|
|
|
|
|
metavalue = "MODE"
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.help = ("'rebuild' - " + _("rebuild package list") +
|
|
|
|
|
",\n'merge' - " + _("append profile package list") +
|
|
|
|
|
",\n'update' - " + _("update package list"))
|
|
|
|
|
self.label = _("Package list")
|
|
|
|
|
|
|
|
|
|
def choice(self):
|
|
|
|
|
return [("rebuild", _("Rebuild")),
|
|
|
|
|
("merge", _("Merge")),
|
|
|
|
|
("update", _("Update"))]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClRebuildWorldSet(Variable):
|
|
|
|
|
"""
|
|
|
|
@ -527,6 +540,40 @@ class VariableClUpdateProfileDependData(ReadonlyTableVariable):
|
|
|
|
|
|
|
|
|
|
setValue = Variable.setValue
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateTemplatesLocate(Variable):
|
|
|
|
|
"""
|
|
|
|
|
Выбранные типы хранилищ шаблонов
|
|
|
|
|
"""
|
|
|
|
|
type = "choice-list"
|
|
|
|
|
element = "selecttable"
|
|
|
|
|
opt = ["-T","--templates"]
|
|
|
|
|
metavalue = "TEMPLATES"
|
|
|
|
|
untrusted = True
|
|
|
|
|
check_after = ['cl_update_profile_system']
|
|
|
|
|
|
|
|
|
|
descriptionMap = {'overlay': _('Overlay templates'),
|
|
|
|
|
'local': _('Local templates'),
|
|
|
|
|
'calculate': _("Calculate overlay templates"),
|
|
|
|
|
'distros': _('Distribution templates'),
|
|
|
|
|
'distro': _('Distribution templates'),
|
|
|
|
|
'remote': _('Remote templates'),
|
|
|
|
|
'clt': _('clt templates')}
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.label = _("Templates location")
|
|
|
|
|
self.help = _("select location for templates %s") \
|
|
|
|
|
%",".join(self.get())
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
dv = self.Get('update.cl_update_profile_datavars')
|
|
|
|
|
if dv:
|
|
|
|
|
return self.Get('cl_templates_locate')
|
|
|
|
|
return dv.Get('cl_template_location') + ['clt']
|
|
|
|
|
|
|
|
|
|
def choice(self):
|
|
|
|
|
return map(lambda x:(x,self.descriptionMap.get(x,_("%s overlay templates")%x)),
|
|
|
|
|
self.get())
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateProfileDependName(FieldValue, ReadonlyVariable):
|
|
|
|
|
type = "list"
|
|
|
|
|
source_variable = "cl_update_profile_depend_data"
|
|
|
|
@ -596,7 +643,7 @@ class VariableClUpdateProfileRep(Variable):
|
|
|
|
|
Текущий репозиторий
|
|
|
|
|
"""
|
|
|
|
|
untrusted = True
|
|
|
|
|
check_after = "cl_update_profile_branch"
|
|
|
|
|
check_after = ["cl_update_profile_branch"]
|
|
|
|
|
|
|
|
|
|
opt = ["--url"]
|
|
|
|
|
|
|
|
|
@ -871,6 +918,7 @@ class DataVarsUpdateProfile(SimpleDataVars):
|
|
|
|
|
VariableOsLinuxShortname(),
|
|
|
|
|
VariableOsLinuxSubname(),
|
|
|
|
|
VariableOsLinuxVer(),
|
|
|
|
|
VariableClTemplateLocation(),
|
|
|
|
|
VariableClUpdateRepData(section="update"),
|
|
|
|
|
VariableClUpdateRepPath(section="update"),
|
|
|
|
|
VariableClUpdateRepRev(section="update"),
|
|
|
|
@ -888,15 +936,15 @@ class DataVarsUpdateProfile(SimpleDataVars):
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateProfileSyncSet(Variable):
|
|
|
|
|
"""
|
|
|
|
|
Не выполнять установку/обновление пакетов при обновлении
|
|
|
|
|
Синхронизировать репозиторий перед сменой профиля
|
|
|
|
|
"""
|
|
|
|
|
type = "bool"
|
|
|
|
|
value = "off"
|
|
|
|
|
opt = ["-s", "--sync"]
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.label = _("Repositories to be synchronized")
|
|
|
|
|
self.help = _("repositories to be synchronized")
|
|
|
|
|
self.label = _("Synchronize the repository")
|
|
|
|
|
self.help = _("Synchronize the repository")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateAutocheckSet(Variable):
|
|
|
|
@ -943,6 +991,18 @@ class VariableClUpdateAutocheckScheduleSet(Variable):
|
|
|
|
|
self.label = _("Consider the autocheck schedule")
|
|
|
|
|
self.help = _("consider the autocheck schedule")
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateEmergelistSet(Variable):
|
|
|
|
|
"""
|
|
|
|
|
Вывести список пакетов в формате emerge
|
|
|
|
|
"""
|
|
|
|
|
type = "bool"
|
|
|
|
|
value = "off"
|
|
|
|
|
opt = ["-e","--emergelist"]
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.label = _("Emerge like package list")
|
|
|
|
|
self.help = _("display package list in emerge format")
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateKernelVersion(ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|
Текущая версия ядра
|
|
|
|
@ -972,3 +1032,4 @@ class VariableClUpdateKernelPkg(ReadonlyVariable):
|
|
|
|
|
else:
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|