Add write autoupdate variable in calculate2.env.

netsetup
Mike Hiretsky 14 years ago
parent 8285394755
commit 61f385bda5

@ -1019,12 +1019,19 @@ 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):
self.setMBR(mbrDisk) and self.setAutoUpdate():
return self.createListOptions()
else:
return False
@ -1312,7 +1319,10 @@ class cl_install(color_print):
def writeInstallVars(self):
if self.clVars.Get('os_root_type') == 'hdd':
self.clVars.Write("os_install_dev_from",
self.clVars.Get('os_root_dev'), header="install",force=True)
self.clVars.Get('os_root_dev'),force=True)
self.clVars.Write("cl_autoupdate_set",
self.clVars.Get("cl_autoupdate_set"), header="main",
force=True)
#if not self.clVars.WriteVars(header="install"):
# raise InstallError(self.getError())

@ -238,21 +238,21 @@ class install_cmd(share_cmd):
else:
self.printERROR(_('variable %s not found')%k)
return False
if options.live:
return 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 options.s:
self.logicObj.setLinuxName(options.s.upper())
if options.build:
if self.optobj.values.s:
self.logicObj.setLinuxName(self.optobj.values.s.upper())
if self.optobj.values.build:
self.logicObj.clVars.Set('os_install_scratch',"on",True)
else:
self.logicObj.clVars.Set('os_install_scratch',"off",True)
return True
def checkAndSetInstallOptions(self,diskOptions, swapOptions, bindOptions,
usersOptions):
"""Check and set disk, swap and bind cmd options"""
listDiskOptions = []
listBindOptions = []
listSwapOptions = []

@ -298,3 +298,5 @@ class Data:
# current system is scratch
os_scratch = {}
# (on or off) autoupdate config from install program
cl_autoupdate_set = {'mode':'w','value': "off"}

@ -43,14 +43,14 @@ if __name__ == "__main__":
if options.l:
if not install.setLang(options.l):
sys.exit(1)
# set values to variables
if not install.setVars(options):
sys.exit(1)
# check and set installed options
if not options.live:
if not install.checkAndSetInstallOptions(options.d,options.w,options.b,
options.u):
sys.exit(1)
# set values to variables
if not install.setVars(options):
sys.exit(1)
# print variables
if options.v or options.filter or options.xml:
install.printVars(options)
@ -71,7 +71,7 @@ if __name__ == "__main__":
else:
forceOpions = options.f or options.P
if not install.installSystem(force=forceOpions, bootDisk=options.mbr,
stdinReadPwd=options.P,builder=options.build):
stdinReadPwd=options.P,builder=options.build):
sys.exit(1)
#if not install.writeVars(options):
# sys.exit(1)

Loading…
Cancel
Save