/usr/lib/python2.7/dist-packages/bzrlib/plugins/pipeline/check-release.py is in bzr-pipeline 1.5-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 27 28 29 30 31 32 | #!/usr/bin/env python
import re
from subprocess import call, PIPE
import sys
def minigrep(pattern, filename):
setup = open(filename, 'rb')
for line in setup:
match = re.search(pattern, line)
if match is not None:
return match
version = minigrep("__version__ = '([^']*)'", '__init__.py').group(1)
print "Release: %s" % version
newsmatch = minigrep('Release %s' % (version), 'NEWS')
if newsmatch is None:
print "NEWS entry missing"
sys.exit(1)
else:
print "NEWS entry found"
setupmatch = minigrep('version="%s"' % (version), 'setup.py')
if setupmatch is None:
print "setup.py is stale"
sys.exit(1)
else:
print "setup.py is good"
if call(['bzr', 'diff'], stdout=PIPE) != 0:
print "Please commit before releasing"
sys.exit(1)
|