Добавляется обновление меню isolinux после rebuild

master3.4
Mike Khiretskiy 9 years ago
parent 2533205fca
commit ef5035ef42

@ -144,7 +144,12 @@ class ClBuilderImageAction(Action):
'warning': _("Restore build system resources"),
'method': 'Builder.mount_target(cl_builder_target)',
'condition': lambda Get: Get('cl_builder_build')
},]
},
{'name': 'update_menu',
'message': "Rescratch",
'condition': lambda Get: Get('cl_builder_rescratch_set') == 'on'
}
]
},
{'name': 'failed',
'error': __("Creating the image is failed"),

@ -36,6 +36,7 @@ class Actions:
ImageSquash = "squash"
ImageIso = "iso"
ImageMenu = "menu"
PrepareAssemble = "prepare"
class VariableAcBuilderSquash(ReadonlyVariable):
@ -57,7 +58,8 @@ class VariableAcBuilderIso(ReadonlyVariable):
def get(self):
action = self.Get("cl_action")
image_action = self.Get('cl_builder_action')
if action == Actions.Image and image_action == Actions.ImageIso:
if action == Actions.Image and image_action in (Actions.ImageIso,
Actions.ImageMenu):
return "on"
return "off"

@ -701,8 +701,9 @@ class VariableClBuilderImageFilename(Variable):
metavalue = "IMAGE"
untrusted = True
live_base_dn = '/run/initramfs/live/iso'
hdd_base_dn = '/var/calculate/linux'
flash_base_dn = '/run/initramfs/live/iso'
flash_iso_base_dn = '/run/initramfs/isoscan/iso'
default_base_dn = '/var/calculate/linux'
def init(self):
self.label = _("Image path")
@ -721,10 +722,12 @@ class VariableClBuilderImageFilename(Variable):
def get(self):
build_id = self.Get('cl_builder_id')
if self.Get('os_root_type') != 'livecd':
base_dn = self.hdd_base_dn
else:
base_dn = self.live_base_dn
base_dn = self.default_base_dn
if self.Get('os_root_type') == 'livecd':
if self.Get('cl_flash_set') == 'on':
base_dn = self.flash_base_dn
# TODO: для iso-scan из flash
if build_id:
imagename = self._isoname()
return path.join(base_dn, imagename)
@ -1205,3 +1208,17 @@ class VariableClBuilderRebuildChangedSet(Variable):
self.help = _("rebuild changed packages")
self.label = _("Rebuild changed packages")
class VariableClBuilderRescratchSet(ReadonlyVariable):
"""
Сборка iso образа на самой флешке
"""
type = "bool"
def get(self):
if self.Get('cl_flash_set') == 'on':
isoimage = self.Get('cl_builder_image_filename')
var = VariableClBuilderImageFilename
if (isoimage.startswith(var.flash_base_dn) or
isoimage.startswith(var.flash_iso_base_dn)):
return "on"
return "off"

@ -27,6 +27,7 @@ from calculate.install.variables.system import VariableOsInstallX11ServerSet
from builder import (VariableClBuilderPath, VariableClBuilderKernel,
VariableClBuilderKernelVer, VariableClBuilderInitrdInstall,
VariableClBuilderVideoDriverPath, VariableClBuilderVideodrvSet)
from action import Actions
_ = lambda x:x
@ -158,6 +159,8 @@ class VariableClBuilderImageData(ReadonlyTableVariable):
pass
def get(self, hr=False):
if self.Get('cl_builder_action') != Actions.ImageMenu:
return [[]]
return list(self.generator())

Loading…
Cancel
Save