from subprocess import Popen
import sys
-from update_copyright import Pipe
+from update_copyright import Pipe, update_authors, update_files
def validate_tag(tag):
"""
something that will work.
vcs_name: new_vcs_name
"""
- print 'set_vcs_name in', filename, 'to', vcs_name
+ print 'set vcs_name in', filename, 'to', vcs_name
p = Pipe([['sed', '-i', "s/^vcs_name:.*/vcs_name: %s/" % vcs_name,
filename]])
assert p.status == 0, p.statuses
print "Handle pending changes before releasing."
sys.exit(1)
set_release_version(tag)
+ update_authors()
+ update_files()
bzr_commit("Bumped to version %s" % tag)
bzr_tag(tag)
create_tarball(tag)
f.write(contents)
f.close()
+def update_files(files=None):
+ if files == None or len(files) == 0:
+ p = Pipe([['grep', '-rc', '# Copyright', '.'],
+ ['grep', '-v', ':0$'],
+ ['cut', '-d:', '-f1']])
+ assert p.status == 0
+ files = p.stdout.rstrip().split('\n')
+
+ for filename in files:
+ if ignored_file(filename) == True:
+ continue
+ update_file(filename)
+
def test():
import doctest
doctest.testmod()
sys.exit(0)
update_authors()
-
- files = args
- if len(files) == 0:
- p = Pipe([['grep', '-rc', '# Copyright', '.'],
- ['grep', '-v', ':0$'],
- ['cut', '-d:', '-f1']])
- assert p.status == 0
- files = p.stdout.rstrip().split('\n')
-
- for filename in files:
- if ignored_file(filename) == True:
- continue
- update_file(filename)
+ update_files(files=args)