diff options
Diffstat (limited to 'cpp/makedist.py')
-rwxr-xr-x | cpp/makedist.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cpp/makedist.py b/cpp/makedist.py index 5b486f3dc52..d449de3b8c4 100755 --- a/cpp/makedist.py +++ b/cpp/makedist.py @@ -176,6 +176,21 @@ def fixMakeRules(file): os.remove(origfile) # +# Fix version in README, INSTALL files +# +def fixVersion(files, version): + + for file in files: + origfile = file + ".orig" + os.rename(file, origfile) + oldFile = open(origfile, "r") + newFile = open(file, "w") + newFile.write(re.sub("@ver@", version, oldFile.read())) + newFile.close() + oldFile.close() + os.remove(origfile) + +# # Check arguments # tag = "-rHEAD" @@ -226,6 +241,7 @@ filesToRemove = [ \ os.path.join("ice", "newmakebindist.py"), \ os.path.join("ice", "RPMTools.py"), \ os.path.join("ice", "fixCopyright.py"), \ + os.path.join("ice", "fixVersion.py"), \ os.path.join("ice", "certs", "makecerts"), \ ] filesToRemove.extend(find("ice", ".dummy")) @@ -341,6 +357,10 @@ if not skipDocs: config = open(os.path.join("ice", "include", "IceUtil", "Config.h"), "r") version = re.search("ICE_STRING_VERSION \"([0-9\.]*)\"", config.read()).group(1) +print "Fixing version in README and INSTALL files..." +fixVersion(find("ice", "README*"), version) +fixVersion(find("ice", "INSTALL*"), version) + # # Create archives. # |