diff options
Diffstat (limited to 'fixVersion.py')
-rwxr-xr-x | fixVersion.py | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/fixVersion.py b/fixVersion.py index cbfd82701dc..a7cccf50055 100755 --- a/fixVersion.py +++ b/fixVersion.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -import os, sys, shutil, fnmatch, re, glob, getopt +import os, sys, shutil, fnmatch, re, glob, getopt, stat # # version pattern @@ -115,7 +115,7 @@ def find(path, patt): # def fileMatchAndReplace(filename, matchAndReplaceExps, warn=True): - mode = os.stat(filename)[ST_MODE] + mode = os.stat(filename).st_mode oldConfigFile = open(filename, "r") newConfigFile = open(filename + ".new", "w") @@ -148,7 +148,7 @@ def fileMatchAndReplace(filename, matchAndReplaceExps, warn=True): if updated: print "updated " + filename os.rename(filename + ".new", filename) - os.chmod(filename, S_IMODE(mode)) + os.chmod(filename, stat.S_IMODE(mode)) elif warn: print "warning: " + filename + " didn't contain any version" os.unlink(filename + ".new") @@ -400,22 +400,24 @@ if patchIceE: fileMatchAndReplace(os.path.join(icee_home, "config", "Make.rules"), [("VERSION[\t\s]*= ([0-9]*\.[0-9]*\.[0-9]*)", version), ("SOVERSION[\t\s]*= ([0-9]*)", soVersion(version))]) - - fileMatchAllAndReplace(os.path.join(icee_home, "src", "IceE", "ice.dsp"), - [("icee([0-9][0-9])d?\.((dll)|(pdb))", soVersion(version))]) - fileMatchAllAndReplace(os.path.join(icee_home, "src", "IceEC", "icec.dsp"), - [("iceec([0-9][0-9])d?\.((dll)|(pdb))", soVersion(version))]) - fileMatchAllAndReplace(os.path.join(icee_home, "test", "Common", "testCommon.dsp"), - [("testCommon([0-9][0-9])d?\.((dll)|(pdb))", soVersion(version))]) + fileMatchAndReplace(os.path.join(icee_home, "config", "Make.rules.mak"), + [("VERSION[\t\s]*= ([0-9]*\.[0-9]*\.[0-9]*)", version), + ("SOVERSION[\t\s]*= ([0-9]*)", soVersion(version))]) - # - # Fix version in IceJ sources - # iceje_home = os.path.join(ice_dir, "javae") if iceje_home: - fileMatchAndReplace(os.path.join(iceje_home, "src", "IceUtil", "Version.java"), - [("ICEE_STRING_VERSION = \"([0-9]*\.[0-9]*\.[0-9]*)\"", version), \ - ("ICEE_INT_VERSION = ([0-9]*)", intVersion(version))]) + fileMatchAndReplace(os.path.join(iceje_home, "src", "Ice", "Util.java"), + [("return \"" + vpatMatch +"\".*A=major", version), \ + ("return ([0-9]*).*AA=major", intVersion(version))]) + + ice_home = os.path.join(ice_dir, "cpp") + if ice_home: + fileMatchAndReplace(os.path.join(ice_home, "src", "slice2cppe", "Gen.h"), + [("ICEE_STRING_VERSION \"([0-9]*\.[0-9]*\.[0-9]*)\"", version), \ + ("ICEE_INT_VERSION ([0-9]*)", intVersion(version))]) + fileMatchAndReplace(os.path.join(ice_home, "src", "slice2javae", "Gen.h"), + [("ICEE_STRING_VERSION \"([0-9]*\.[0-9]*\.[0-9]*)\"", version), \ + ("ICEE_INT_VERSION ([0-9]*)", intVersion(version))]) sys.exit(0) |