From: Holger Levsen Date: Fri, 30 Mar 2012 13:16:45 +0000 (+0200) Subject: fail the build if section is unknown X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=6c98fa53fae91f523ed544e60c88386fff0c2d13;p=profitbricks%2Fjenkins-build-scripts.git fail the build if section is unknown --- diff --git a/debian_build.py b/debian_build.py index 884deb0..8a3f566 100755 --- a/debian_build.py +++ b/debian_build.py @@ -286,7 +286,7 @@ if __name__ == '__main__': changelog = parse_changelog.stdout - cmd = ['grep-dctrl', '-n', '-s', 'Source,Version,Distribution', ''] + cmd = ['grep-dctrl', '-n', '-s', 'Source,Version,Distribution,Section', ''] grep_dctrl = subprocess.Popen( cmd, shell=False, @@ -316,6 +316,14 @@ 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...') + raise Exception('debian/control sets "section" to unknown. This is not allowed, failing...') + exit_error() + # enforce correct distribution in debian/changelog for master and hotfix branches if (GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/')) and not distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates'): logger_error('Distribution %s in debian/changelog did not match branch %s' % (distribution, options.distribution))