File: check-release.py

package info (click to toggle)
bzrtools 2.6.0-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 740 kB
  • sloc: python: 4,299; sh: 13; makefile: 10
file content (26 lines) | stat: -rwxr-xr-x 755 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
import os
import re
from subprocess import call, PIPE
import sys

sys.path.insert(0, '/home/abentley/bzrplugins')
sys.path.insert(0, os.path.dirname(os.path.realpath('/home/abentley/bin/bzr')))
import bzrtools
print "bzrtools version: %s" % bzrtools.__version__
def minigrep(pattern, filename):
    setup = open(filename, 'rb')
    for line in setup:
        match = re.search(pattern, line)
        if match is not None:
            return match

newsmatch = minigrep('RELEASE: bzrtools %s' % (bzrtools.__version__), 'NEWS')
if newsmatch is None:
    print "NEWS entry missing"
    sys.exit(1)
else:
    print "NEWS entry found"
if call(['bzr', 'diff'], stdout=PIPE) != 0:
    print "Please commit before releasing"
    sys.exit(1)