]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
deal with master branch
authorHolger Levsen <holger@layer-acht.org>
Wed, 31 Aug 2011 17:21:21 +0000 (19:21 +0200)
committerHolger Levsen <holger@layer-acht.org>
Wed, 31 Aug 2011 17:21:21 +0000 (19:21 +0200)
build.py

index 266989afed8436ca3aec5a6d9793be6ae1fbd011..472da262872d3e84cc78babbaed6a825634302fa 100755 (executable)
--- a/build.py
+++ b/build.py
@@ -343,6 +343,34 @@ if __name__ == '__main__':
         subprocess.check_call(cmd)
         cmd = ['/usr/bin/git', 'commit', '-a', '-m', 'add changelog']
         subprocess.check_call(cmd)
+    else:
+       # so we're in the master branch...
+       # (or maybe in other branches, but thats not specified _yet_)
+       # TODO errorchecking etc
+        cmd = ['dpkg-parsechangelog']
+       parse_changelog =  subprocess.Popen(
+                cmd,
+                shell=False,
+                close_fds=True,
+                stdout=subprocess.PIPE,
+                stderr=subprocess.PIPE,
+                cwd='./'
+        )
+       ret = parse_changelog.wait()
+        stdout_msg = parse_changelog.stdout.read()
+
+       cmd = ['grep-dctrl', '-n', '-s', "Version ''", stdout_msg]
+       grep_dctrl =  subprocess.Popen(
+                cmd,
+                shell=False,
+                close_fds=True,
+                stdout=subprocess.PIPE,
+                stderr=subprocess.PIPE,
+                cwd='./'
+        )
+       ret = grep_dctrl.wait()
+        version = grep_dctrl.stdout.read()
+
 
     if not GIT_COMMITTER_EMAIL:
         for commit in repo.commits():