mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-15 01:56:17 +01:00
Fix crash in 'updatepacmetafromspec' command when working with an incomplete spec
This commit is contained in:
parent
8c58425813
commit
f7f9506f96
@ -4370,7 +4370,9 @@ def read_meta_from_spec(specfile, *args):
|
|||||||
section_pat = r'^%s\s*?$'
|
section_pat = r'^%s\s*?$'
|
||||||
for section in sections:
|
for section in sections:
|
||||||
m = re.compile(section_pat % section, re.I | re.M).search(''.join(lines))
|
m = re.compile(section_pat % section, re.I | re.M).search(''.join(lines))
|
||||||
if m:
|
if m is None:
|
||||||
|
spec_data[section] = ""
|
||||||
|
continue
|
||||||
start = lines.index(m.group() + '\n') + 1
|
start = lines.index(m.group() + '\n') + 1
|
||||||
data = []
|
data = []
|
||||||
for line in lines[start:]:
|
for line in lines[start:]:
|
||||||
|
Loading…
Reference in New Issue
Block a user