makekconfig.zsh: Don't crash when options don't have dependencies
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
9f54c866ed
commit
48a2b87ecd
|
@ -42,9 +42,12 @@ class Option:
|
|||
self.state = "y"
|
||||
self.res = None
|
||||
|
||||
depends = re.search("\sdepends on (.*?)\n", opt).group(1).strip()
|
||||
depends = [ d.strip() for d in re.split("[&&|=m|=y|=n]", depends) ]
|
||||
self.depends = set([ d for d in depends if len(d) > 0 ])
|
||||
if search := re.search("\sdepends on (.*?)\n", opt):
|
||||
depends = search.group(1).strip()
|
||||
depends = [ d.strip() for d in re.split("[&&|=m|=y|=n]", depends) ]
|
||||
self.depends = set([ d for d in depends if len(d) > 0 ])
|
||||
else:
|
||||
self.depends = set()
|
||||
|
||||
def __repr__(self):
|
||||
return f"{self.name}:{self.type}"
|
||||
|
|
Loading…
Reference in New Issue