[Zodb-checkins] CVS: ZODB3 - NEWS.txt:1.33.6.25 release.py:1.1.2.2
Tim Peters
tim.one at comcast.net
Wed Jun 9 14:35:36 EDT 2004
Update of /cvs-repository/ZODB3
In directory cvs.zope.org:/tmp/cvs-serv19170
Modified Files:
Tag: Zope-2_7-branch
NEWS.txt release.py
Log Message:
Backport many improvements to release.py from the 3.3 trunk. Other
changes are incidental to testing this.
=== ZODB3/NEWS.txt 1.33.6.24 => 1.33.6.25 ===
--- ZODB3/NEWS.txt:1.33.6.24 Sat May 22 12:04:44 2004
+++ ZODB3/NEWS.txt Wed Jun 9 14:35:04 2004
@@ -124,7 +124,7 @@
What's new in ZODB3 3.2
=======================
-Release date: 08-Oct-2003
+Release date: DD-MMM-2004
Nothing has changed since release candidate 1.
=== ZODB3/release.py 1.1.2.1 => 1.1.2.2 ===
--- ZODB3/release.py:1.1.2.1 Tue Sep 30 15:37:29 2003
+++ ZODB3/release.py Wed Jun 9 14:35:04 2004
@@ -7,22 +7,44 @@
date should be a string like "23-Sep-2003"
The following files are updated:
- - setup.py gets a version number
+ - setup.py
+ - NEWS.txt
+ - doc/guide/zodb.tex
+ - ZEO/__init__.py
+ - ZEO/version.txt
+ - ZODB/__init__.py
"""
import fileinput
import os
import re
-def fixpath(path):
- parts = path.split("/")
- return os.sep.join(parts)
-
+# In file filename, replace the first occurrence of regexp pat with
+# string repl.
def replace(filename, pat, repl):
- parts = filename.split("/")
- filename = os.sep.join(parts)
+ from sys import stderr as e # fileinput hijacks sys.stdout
+ foundone = False
for line in fileinput.input([filename], inplace=True, backup="~"):
- print re.sub(pat, repl, line),
+ if foundone:
+ print line,
+ else:
+ match = re.search(pat, line)
+ if match is not None:
+ foundone = True
+
+ new = re.sub(pat, repl, line)
+ print new,
+
+ print >> e, "In %s, replaced:" % filename
+ print >> e, " ", repr(line)
+ print >> e, " ", repr(new)
+
+ else:
+ print line,
+
+ if not foundone:
+ print >> e, "*" * 60, "Oops!"
+ print >> e, " Failed to find %r in %r" % (pat, filename)
def compute_zeoversion(version):
# ZEO version's trail ZODB versions by one full revision.
@@ -32,23 +54,30 @@
return "%s.%s" % (major, rest)
def write_zeoversion(path, version):
- f = open(fixpath(path), "wb")
+ f = file(path, "w")
print >> f, version
f.close()
def main(args):
version, date = args
zeoversion = compute_zeoversion(version)
-
- replace("setup.py", 'version="\S+"', 'version="%s"' % version)
- replace("README.txt", "'\d+\.\d+[a-z]?\d*'", "'%s'" % version)
+
+ replace("setup.py",
+ r'version="\S+"',
+ 'version="%s"' % version)
replace("ZODB/__init__.py",
- "__version__ = '\S+'", "__version__ = '%s'" % version)
+ r'__version__ = "\S+"',
+ '__version__ = "%s"' % version)
replace("ZEO/__init__.py",
- 'version = "\S+"', 'version = "%s"' % zeoversion)
+ r'version = "\S+"',
+ 'version = "%s"' % zeoversion)
write_zeoversion("ZEO/version.txt", zeoversion)
replace("NEWS.txt",
- "Release date: XX-\S+-\S+", "Release date: %s" % date)
+ r"^Release date: .*",
+ "Release date: %s" % date)
+ replace("doc/guide/zodb.tex",
+ r"release{\S+}",
+ "release{%s}" % version)
if __name__ == "__main__":
import sys
More information about the Zodb-checkins
mailing list