Добавлен параметр для установки системы для обновления пакетов при первой загрузке

* cl_install_update_pkg_set (--update-pkg, -k)
  включена по умолчанию если у машины есть IP адрес и в custom.<short>
  сете есть хотя бы один пакет
develop 3.6.3
parent 4aaf71035e
commit 003ff5d128

@ -23,7 +23,7 @@ from calculate.lib.datavars import (Variable, VariableError, ReadonlyVariable,
DataVarsError, VariableInterface) DataVarsError, VariableInterface)
from calculate.install.fs_manager import FileSystemManager from calculate.install.fs_manager import FileSystemManager
from calculate.lib.utils.files import (readFile, getProgPath, process, from calculate.lib.utils.files import (readFile, getProgPath, process,
readLinesFile) readLinesFile, readFileEx)
from calculate.lib.utils.common import (getPasswdUsers, getUserGroups, from calculate.lib.utils.common import (getPasswdUsers, getUserGroups,
getGroups, CmdlineParams) getGroups, CmdlineParams)
from calculate.lib.utils.common import getValueFromConfig, getValueFromCmdLine from calculate.lib.utils.common import getValueFromConfig, getValueFromCmdLine
@ -978,6 +978,35 @@ class FlashUncompatible(VariableInterface):
return "" return ""
class VariableClInstallUpdatePkgSet(Variable):
"""
При установке системы создать сценарии запуска cl-update в конце
первой загрузки
"""
type = "bool"
opt = ["--update-pkg","-K"]
def system_has_ip(self):
return bool(self.Get('os_net_ip'))
def custom_set_has_packages(self):
install_short = self.Get('os_install_linux_shortname')
now_short = self.Get('os_linux_shortname')
setfile = "/etc/portage/sets/custom.{}".format(now_short.lower())
if readFileEx(setfile, grab=True) and install_short == now_short:
return True
return False
def get(self):
if self.system_has_ip() and self.custom_set_has_packages():
return "on"
return "off"
def init(self):
self.help = _("update packages at first boot")
self.label = _("Update packages at first boot")
try: try:
import calculate.update.variables.update as update import calculate.update.variables.update as update

@ -140,7 +140,8 @@ class Wsdl(WsdlBase):
normal=('cl_install_autocheck_set', normal=('cl_install_autocheck_set',
'cl_install_autocheck_interval', 'cl_install_autocheck_interval',
'cl_install_cleanpkg_set', 'cl_install_cleanpkg_set',
'cl_install_other_set'))], 'cl_install_other_set'),
expert=('cl_install_update_pkg_set',))],
# действие выводит информацию перед запуском # действие выводит информацию перед запуском
'brief': {'next': __("Run"), 'brief': {'next': __("Run"),
'image': 'finish', 'image': 'finish',

Loading…
Cancel
Save