]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
correctly fail build on unknown sections
authorHolger Levsen <holger@layer-acht.org>
Mon, 14 Jan 2013 17:48:07 +0000 (18:48 +0100)
committerHolger Levsen <holger@layer-acht.org>
Mon, 14 Jan 2013 17:48:07 +0000 (18:48 +0100)
debian_build.py

index d1e8c4f5b0ab38486627d343b2b02da48ce48ae3..794beee01f07ecc007664dba08f06eb7928f9fb2 100755 (executable)
@@ -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()