Add variable cl_install_autoupdate_set.

netsetup
Mike Hiretsky 14 years ago
parent bb8deeb756
commit 97e474609d

@ -1033,6 +1033,8 @@ class fillVars(object, glob_attr):
def getFieldByField(self,resField,field,value, firstPrefix="os_disk",
secondPrefix="os_disk"):
"""Get value of field specified by 'firstPrefix_resField',
by field specified by 'secondPrefix_resField==value'"""
res = filter(lambda x: x[1] == value,
zip(self.clVars.Get('%s_%s'%(firstPrefix,resField)),
self.clVars.Get('%s_%s'%(secondPrefix,field)))) or\
@ -1052,3 +1054,12 @@ class fillVars(object, glob_attr):
return self.Get('os_device_dev')[0]
else:
return ""
def get_cl_install_autoupdate_set(self):
if self.Get('cl_install_system_action') == "up":
if self.Get('os_install_linux_system') == 'desktop':
return "on"
else:
return "off"
else:
return self.Get('cl_autoupdate_set')

@ -1163,19 +1163,12 @@ class cl_install(color_print):
disk['systemId'] = None
return True
def setAutoUpdate(self):
if self.clVars.Get('os_install_linux_system') == 'desktop':
self.clVars.Set('cl_autoupdate_set','on',force=True)
else:
self.clVars.Set('cl_autoupdate_set','off',force=True)
return True
def setInstallOptions(self, listDisks, listBinds, listSwaps, listUsers,
mbrDisk):
"""Set install options (set users, disks and mbr"""
if self.setUsers(listUsers) and \
self.setDisks(listDisks,listBinds,listSwaps) and \
self.setMBR(mbrDisk) and self.setAutoUpdate():
self.setMBR(mbrDisk):
return self.createListOptions()
else:
return False
@ -1422,6 +1415,7 @@ class cl_install(color_print):
self.startMessage = ""
def setupOpenGL(self):
"""Setup opengl for current video driver"""
defaultGL = "xorg-x11"
pathGlModules = path.join(self.clVars.Get('cl_chroot_path'),
'usr/lib/opengl')

@ -112,7 +112,8 @@ class install_cmd(share_cmd):
check_values=self.checkOpts)
self.logicObj = cl_install()
# names incompatible options with --live
self.optionsLiveIncompatible = ["d", "b", "mbr", "w", "f", "s"]
self.optionsLiveIncompatible = ["type","d", "b", "mbr",
"w", "f", "s","install","uninstall","build","u"]
def _getNamesAllSetOptions(self):
"""Get list set options"""
@ -246,13 +247,14 @@ class install_cmd(share_cmd):
return False
return True
def setAction(self,live):
"""Set action by configuration or install system"""
self.logicObj.clVars.Set('cl_action',
"merge" if live else "system",True)
def checkAndSetInstallOptions(self,diskOptions, swapOptions, bindOptions,
usersOptions):
"""Check and set disk, swap and bind cmd options"""
if self.optobj.values.live:
self.logicObj.clVars.Set('cl_action','merge',True)
else:
self.logicObj.clVars.Set('cl_action','system',True)
if self.optobj.values.s:
self.logicObj.setLinuxName(self.optobj.values.s.upper())
if self.optobj.values.build:
@ -380,18 +382,3 @@ class install_cmd(share_cmd):
return True
else:
return False
def setAutoupdate(self, optObj):
"""Установка переменных"""
if optObj.set:
for vals in optObj.set:
for val in vals.split(','):
k,o,v = val.partition('=')
if k == "cl_autoupdate_set":
if self.logicObj.clVars.exists(k):
if not self.logicObj.clVars.SetWriteVar(k,v):
return False
else:
self.printERROR(_('variable %s not found')%k)
return False
return True

@ -299,4 +299,7 @@ class Data:
os_scratch = {}
# (on or off) autoupdate config from install program
cl_autoupdate_set = {'mode':'w','value': "off"}
cl_autoupdate_set = {'value': "off"}
# (on or off) autoupdate config from install program for install
cl_install_autoupdate_set = {'mode':'w','value': "off"}

@ -47,13 +47,11 @@ if __name__ == "__main__":
if not install.setVars(options):
sys.exit(1)
# check and set installed options
install.setAction(options.live)
if not options.live:
if not install.checkAndSetInstallOptions(options.d,options.w,options.b,
options.u):
sys.exit(1)
# refresh autoupdate
if not install.setAutoupdate(options):
sys.exit(1)
# print variables
if options.v or options.filter or options.xml:
install.printVars(options)

Loading…
Cancel
Save