Have release.py update copyrights as well.
authorW. Trevor King <wking@drexel.edu>
Fri, 20 Nov 2009 12:57:17 +0000 (07:57 -0500)
committerW. Trevor King <wking@drexel.edu>
Fri, 20 Nov 2009 12:57:17 +0000 (07:57 -0500)
release.py
update_copyright.py

index d064b11ec08d17ef1187f219918701bec9f95aad..996e3631fa0d95680dc884cd4a31a6948953851e 100755 (executable)
@@ -23,7 +23,7 @@ import string
 from subprocess import Popen
 import sys
 
-from update_copyright import Pipe
+from update_copyright import Pipe, update_authors, update_files
 
 def validate_tag(tag):
     """
@@ -103,7 +103,7 @@ def set_vcs_name(filename, vcs_name='None'):
     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
@@ -154,6 +154,8 @@ For example
         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)
index 4a52fee8843c312a74b868513d75ac60c35dac80..6cdaa2fb88bfebdadd70af023e288a17a38cfa21 100755 (executable)
@@ -409,6 +409,19 @@ def update_file(filename, verbose=True):
     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() 
@@ -439,16 +452,4 @@ automatically.
         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)