From: Holger Levsen Date: Mon, 14 Jan 2013 17:48:07 +0000 (+0100) Subject: correctly fail build on unknown sections X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=da72fb8e38b7f6d91fdb7f5ba854c38b1007599b;p=profitbricks%2Fjenkins-build-scripts.git correctly fail build on unknown sections --- 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()