From da72fb8e38b7f6d91fdb7f5ba854c38b1007599b Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 14 Jan 2013 18:48:07 +0100 Subject: [PATCH] correctly fail build on unknown sections --- debian_build.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/debian_build.py b/debian_build.py index d1e8c4f..794beee 100755 --- a/debian_build.py +++ b/debian_build.py @@ -350,7 +350,7 @@ if __name__ == '__main__': changelog = parse_changelog.stdout - cmd = ['grep-dctrl', '-n', '-s', 'Source,Version,Distribution,Section', ''] + cmd = ['grep-dctrl', '-n', '-s', 'Source,Version,Distribution', ''] grep_dctrl = subprocess.Popen( cmd, shell=False, @@ -380,11 +380,12 @@ if __name__ == '__main__': distribution = distribution.strip() logger.info('Package distribution is %s' % (distribution)) - section = grep_dctrl.stdout.readline() - section = section.strip() - logger.info('Package section is %s' % (section)) - if section == 'unknown': - logger.error('debian/control sets "section" to unknown. This is not allowed, failing...') + section_error=False + for line in fileinput.input('debian/changelog'): + if line.lower() == 'section: unknown': + logger.error('debian/control sets "section" to unknown. This is not allowed, failing...') + section_error=True + if section_error: raise Exception('debian/control sets "section" to unknown. This is not allowed, failing...') exit_error() -- 2.39.5