4
from subprocess import call, PIPE
7
sys.path.insert(0, '..')
8
sys.path.insert(0, os.path.dirname(os.path.realpath('/home/abentley/bin/bzr')))
10
print "bzrtools version: %s" % bzrtools.__version__
11
def minigrep(pattern, filename):
12
setup = open(filename, 'rb')
14
match = re.search(pattern, line)
18
newsmatch = minigrep('RELEASE: bzrtools %s' % (bzrtools.__version__), 'NEWS')
20
print "NEWS entry missing"
23
print "NEWS entry found"
24
final_name = '../bzrtools-release/bzrtools-%s.tar.gz' % bzrtools.__version__
25
if os.path.exists('../bzrtools.tar.gz'):
26
print "Temp file exists already."
28
if os.path.exists(final_name):
29
print "Final file exists already."
31
if call(['bzr', 'diff'], stdout=PIPE) != 0:
32
print "Please commit before releasing"
34
retcode = call(['bzr', 'tag', 'release-%s' % bzrtools.__version__])
37
retcode = call(['bzr', 'export', '../bzrtools.tar.gz'])
40
os.rename('../bzrtools.tar.gz', final_name)
41
print 'Created %s' % final_name
42
call(['gpg', '--detach-sign', final_name])
44
#call(['scp', final_name, final_name + '.sig',
45
# 'panoramicfeedback.com:opensource/'])