]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
include fix again for printing changelog
authorMathias Klette <mathias.klette@profitbricks.com>
Fri, 3 May 2013 12:58:50 +0000 (14:58 +0200)
committerMathias Klette <mathias.klette@profitbricks.com>
Fri, 3 May 2013 12:58:50 +0000 (14:58 +0200)
debian_build.py

index d2308bcc2e9a558970dc4bf544cba92bb82f1f5f..9a6d09351e7a59e0c8de8fb4ea3f0461d6b9b91c 100755 (executable)
@@ -330,12 +330,11 @@ if __name__ == '__main__':
 
 
     # let me see the first two changelog entries:
-    line_counter = 0
-    for line in fileinput.input('debian/changelog'):
-        if line.startswith(' --'):
-            line_counter += 1
-        if line_counter <= 2:
-            print('debian/changelog: %s' %(line.rstrip('\n')))
+    # TODO: use changelog python libs instead of DCH calls, see above
+    cl = changelog.Changelog()
+    cl.parse_changelog(open('debian/changelog'))
+    logger.info('New changelog:\n\n%s' %(
+            ''.join([block.__str__() for block in cl._blocks[0:2]])))
 
 
     # ACT IV: preparations are set, let's build