distribution = distribution.strip()
logger.info('Package distribution is %s' % (distribution))
- if (options.distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates') and not distribution in ('stable', 'stable-proposed-updates', 'production', 'production-proposed-updates')):
+ # 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))
raise Exception(
'Distribution %s in debian/changelog did not match branch %s' % (distribution, options.distribution)