aurinfo: Fix bug with space indents creating split packages

If a .SRCINFO line doesn't start with a tab, check if the key is pkgname
before adding it as a package.

Fixes a bug where if you have accidentally gotten a line indented with
spaces, from that line forward it will think it is a split package,
instead of erroring out.

Reported-by: Raansu <Gero3977@gmail.com>
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Johannes Löthberg 2015-06-13 01:52:08 +02:00 committed by Lukas Fleischer
parent 5fb7a74e23
commit cc6c7a1caa

View file

@ -132,8 +132,12 @@ def ParseAurinfoFromIterable(iterable, ecatcher=None):
if key == 'pkgbase': if key == 'pkgbase':
current_package = aurinfo.SetPkgbase(value) current_package = aurinfo.SetPkgbase(value)
else: elif key == 'pkgname':
current_package = aurinfo.AddPackage(value) current_package = aurinfo.AddPackage(value)
else:
ecatcher.Catch(lineno, 'unexpected new section not starting '
'with \'pkgname\' found')
continue
else: else:
# package attribute # package attribute
if current_package is None: if current_package is None: