|
|
|
@ -54,11 +54,9 @@ CMD_OPTIONS = [{'shortOption':"d",
|
|
|
|
|
},
|
|
|
|
|
{'longOption':"source",
|
|
|
|
|
'optVal':"SOURCE",
|
|
|
|
|
'type':'choice',
|
|
|
|
|
'default':'stage',
|
|
|
|
|
'choices_regignore':["stage"]+OSSYSTEM_LIST,
|
|
|
|
|
'help':_("base stage for assembling") + " " +
|
|
|
|
|
_("(stage or %s)")%",".join(OSSYSTEM_LIST)
|
|
|
|
|
_("(stage or shortname)")
|
|
|
|
|
},
|
|
|
|
|
{'longOption':"ver",
|
|
|
|
|
'optVal':"VER",
|
|
|
|
@ -126,15 +124,24 @@ class assemble_cmd(share_cmd):
|
|
|
|
|
self.logicObj = cl_assemble()
|
|
|
|
|
self.optionsConfigureIncompatible=["U","b","skipfirst","m","break"]
|
|
|
|
|
self.optionsBreakIncompatible=["U","b","skipfirst","m","c","ver",
|
|
|
|
|
"no_unmount","sync"]
|
|
|
|
|
"no_unmount","sync","source"]
|
|
|
|
|
self.optionsDependenceIncompatible=["U","b","skipfirst","m","break","c",
|
|
|
|
|
"no_unmount","sync"]
|
|
|
|
|
"no_unmount","sync","source"]
|
|
|
|
|
self.optionsMakeIncompatible=["U","c","u","break","no_unmount",
|
|
|
|
|
"sync"]
|
|
|
|
|
"sync","source"]
|
|
|
|
|
self.optionsUpdateIncompatible=["U","c","break","m","no_unmount",
|
|
|
|
|
"sync"]
|
|
|
|
|
"sync","source"]
|
|
|
|
|
self.optionsUpdatenosyncIncompatible=["u","c","break","m","no_unmount",
|
|
|
|
|
"sync"]
|
|
|
|
|
"sync","source"]
|
|
|
|
|
|
|
|
|
|
def checkChoice(self,option,value,values):
|
|
|
|
|
"""Check choice and raise error"""
|
|
|
|
|
if not value.upper() in map(lambda x:x.upper(),values):
|
|
|
|
|
self.optobj.error(_("option %s")%option+
|
|
|
|
|
": "+
|
|
|
|
|
_("invalid choice")+": '%s'"%value +
|
|
|
|
|
" (%s)"%_("choose from %s")%
|
|
|
|
|
", ".join(values))
|
|
|
|
|
|
|
|
|
|
def checkOpts(self, values, args):
|
|
|
|
|
"""Check values all specified options."""
|
|
|
|
@ -181,6 +188,11 @@ class assemble_cmd(share_cmd):
|
|
|
|
|
if values.ver:
|
|
|
|
|
self.logicObj.clVars.Set('os_assemble_linux_ver',
|
|
|
|
|
values.ver,True)
|
|
|
|
|
self.setAction()
|
|
|
|
|
if values.source:
|
|
|
|
|
validSources = map(lambda x:x.upper(),
|
|
|
|
|
self.logicObj.getValidSource())+["stage"]
|
|
|
|
|
self.checkChoice("--source",values.source, validSources)
|
|
|
|
|
self.optobj.checkVarSyntax(values)
|
|
|
|
|
return (values, args)
|
|
|
|
|
|
|
|
|
|