|
|
@ -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
|
|
|
|
|
|
|
|
|
|
|
|