diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-01-31 18:49:34 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-01-31 18:49:34 +0000 |
commit | 0f76db6b442a9c7985adbe5b8a3f06469ccbe9b3 (patch) | |
tree | a04395675afff4f27841ab86f668117d7a9f7904 /cpp | |
parent | Fixed bug 1720 (diff) | |
download | ice-0f76db6b442a9c7985adbe5b8a3f06469ccbe9b3.tar.bz2 ice-0f76db6b442a9c7985adbe5b8a3f06469ccbe9b3.tar.xz ice-0f76db6b442a9c7985adbe5b8a3f06469ccbe9b3.zip |
Beta versioning
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/config/Make.rules | 5 | ||||
-rw-r--r-- | cpp/config/Make.rules.mak | 4 | ||||
-rw-r--r-- | cpp/config/TestUtil.py | 9 | ||||
-rw-r--r-- | cpp/config/templates.xml | 2 | ||||
-rw-r--r-- | cpp/demo/IceStorm/clock/config.icebox | 2 | ||||
-rw-r--r-- | cpp/demo/IceStorm/counter/config.icebox | 2 | ||||
-rwxr-xr-x | cpp/fixVersion.py | 146 | ||||
-rw-r--r-- | cpp/include/IceUtil/Config.h | 4 | ||||
-rw-r--r-- | cpp/src/Ice/DynamicLibrary.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/Initialize.cpp | 22 | ||||
-rw-r--r-- | cpp/src/Slice/CPlusPlusUtil.cpp | 32 | ||||
-rwxr-xr-x | cpp/src/ca/iceca | 2 |
12 files changed, 172 insertions, 70 deletions
diff --git a/cpp/config/Make.rules b/cpp/config/Make.rules index f145c166a0f..443f533c107 100644 --- a/cpp/config/Make.rules +++ b/cpp/config/Make.rules @@ -114,9 +114,8 @@ KERBEROS_HOME ?= /usr/kerberos SHELL = /bin/sh VERSION_MAJOR = 3 VERSION_MINOR = 2 -VERSION_PATCH = 0 -VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH) -SOVERSION = $(VERSION_MAJOR)$(VERSION_MINOR) +VERSION = 3.2b +SOVERSION = 32b bindir = $(top_srcdir)/bin libdir = $(top_srcdir)/lib diff --git a/cpp/config/Make.rules.mak b/cpp/config/Make.rules.mak index 845b2d1c7c4..0ea97bd0ff4 100644 --- a/cpp/config/Make.rules.mak +++ b/cpp/config/Make.rules.mak @@ -57,8 +57,8 @@ THIRDPARTY_HOME = C:\Ice-$(VERSION)-ThirdParty-$(TPH_EXT) # ---------------------------------------------------------------------- SHELL = /bin/sh -VERSION = 3.2.0 -SOVERSION = 32 +VERSION = 3.2b +SOVERSION = 32b bindir = $(top_srcdir)\bin libdir = $(top_srcdir)\lib includedir = $(top_srcdir)\include diff --git a/cpp/config/TestUtil.py b/cpp/config/TestUtil.py index 42ecfeafe2c..4196c013721 100644 --- a/cpp/config/TestUtil.py +++ b/cpp/config/TestUtil.py @@ -84,7 +84,14 @@ def getIceSoVersion(): intVersion = int(re.search("ICE_INT_VERSION ([0-9]*)", config.read()).group(1)) majorVersion = intVersion / 10000 minorVersion = intVersion / 100 - 100 * majorVersion - return '%d' % (majorVersion * 10 + minorVersion) + patchVersion = intVersion % 100 + if patchVersion > 50: + if patchVersion >= 52: + return '%db%d' % (majorVersion * 10 + minorVersion, patchVersion - 50) + else: + return '%db' % (majorVersion * 10 + minorVersion) + else: + return '%d' % (majorVersion * 10 + minorVersion) def isCygwin(): diff --git a/cpp/config/templates.xml b/cpp/config/templates.xml index 7912b9c2a88..7a84c8e4c1a 100644 --- a/cpp/config/templates.xml +++ b/cpp/config/templates.xml @@ -64,7 +64,7 @@ <parameter name="publish-endpoints" default="default"/> <parameter name="flush-timeout" default="1000"/> - <service name="IceStorm${index}" entry="IceStormService,32:createIceStorm"> + <service name="IceStorm${index}" entry="IceStormService,32b:createIceStorm"> <dbenv name="${service}"/> diff --git a/cpp/demo/IceStorm/clock/config.icebox b/cpp/demo/IceStorm/clock/config.icebox index cd05e35ff37..2137d0ce61f 100644 --- a/cpp/demo/IceStorm/clock/config.icebox +++ b/cpp/demo/IceStorm/clock/config.icebox @@ -6,7 +6,7 @@ Ice.OA.IceBox.ServiceManager.Endpoints=tcp -p 9998 # # The IceStorm service # -IceBox.Service.IceStorm=IceStormService,32:createIceStorm --Ice.Config=config.service +IceBox.Service.IceStorm=IceStormService,32b:createIceStorm --Ice.Config=config.service # # Warn about connection exceptions diff --git a/cpp/demo/IceStorm/counter/config.icebox b/cpp/demo/IceStorm/counter/config.icebox index cd05e35ff37..2137d0ce61f 100644 --- a/cpp/demo/IceStorm/counter/config.icebox +++ b/cpp/demo/IceStorm/counter/config.icebox @@ -6,7 +6,7 @@ Ice.OA.IceBox.ServiceManager.Endpoints=tcp -p 9998 # # The IceStorm service # -IceBox.Service.IceStorm=IceStormService,32:createIceStorm --Ice.Config=config.service +IceBox.Service.IceStorm=IceStormService,32b:createIceStorm --Ice.Config=config.service # # Warn about connection exceptions diff --git a/cpp/fixVersion.py b/cpp/fixVersion.py index 8463c728171..31b674021cc 100755 --- a/cpp/fixVersion.py +++ b/cpp/fixVersion.py @@ -3,6 +3,13 @@ import os, sys, shutil, fnmatch, re, glob, getopt # +# version pattern +# +vpatCheck = "[0-9]+\.[0-9]+(\.[0-9]+|b[0-9]*)$" +vpatParse = "([0-9]+)\.([0-9]+)(\.[0-9]+|b[0-9]*)" +vpatMatch = "([0-9]+\.[0-9]+(\.[0-9]+|b[0-9]*))" + +# # Program usage. # def usage(): @@ -15,31 +22,53 @@ def usage(): def intVersion(version): - r = re.search("([0-9]*)\.([0-9]*)\.([0-9]*)", version) + r = re.search(vpatParse, version) major = int(r.group(1)) minor = int(r.group(2)) - patch = int(r.group(3)) - return ("%2d%02d%02d" % (major, minor, patch)).strip() + gr3 = r.group(3) + patch = -1 + if gr3.startswith("."): + patch = int(gr3[1:]) + else: + if len(gr3) > 1: + patch = 50 + int(gr3[1:]) + else: + patch = 51 + return ("%2d%02d%02d" % (major, minor, patch)).strip() def soVersion(version): - r = re.search("([0-9]*)\.([0-9]*)\.([0-9]*)", version) + r = re.search(vpatParse, version) major = int(r.group(1)) minor = int(r.group(2)) - return ("%d%d" % (major, minor)).strip() + v = ("%d%d" % (major, minor)).strip() + if r.group(3).startswith("b"): + return v + "b" + else: + return v def majorVersion(version): - r = re.search("([0-9]*)\.([0-9]*)\.([0-9]*)", version) + r = re.search(vpatParse, version) major = int(r.group(1)) return ("%d" % (major)).strip() def minorVersion(version): - r = re.search("([0-9]*)\.([0-9]*)\.([0-9]*)", version) + r = re.search(vpatParse, version) minor = int(r.group(2)) return ("%d" % (minor)).strip() def patchVersion(version): - r = re.search("([0-9]*)\.([0-9]*)\.([0-9]*)", version) - patch = int(r.group(3)) + r = re.search(vpatParse, version) + + gr3 = r.group(3) + patch = -1 + if gr3.startswith("."): + patch = int(gr3[1:]) + else: + if len(gr3) > 1: + patch = 50 + int(gr3[1:]) + else: + patch = 51 + return ("%d" % (patch)).strip() # @@ -175,8 +204,11 @@ if len(args) != 1: sys.exit(1) version = args[0] -if not re.match("[0-9]*\.[0-9]*\.[0-9]*$", version): - print "invalid version number: " + version + " (it should have the form A.B.C)" + + + +if not re.match(vpatCheck, version): + print "invalid version number: " + version + " (it should have the form 3.2.1 or 3.2b or 3.2b2)" sys.exit(0) if not patchIceE: @@ -186,37 +218,43 @@ if not patchIceE: ice_home = findSourceTree("ice", os.path.join("include", "IceUtil", "Config.h")) if ice_home: fileMatchAndReplace(os.path.join(ice_home, "include", "IceUtil", "Config.h"), - [("ICE_STRING_VERSION \"([0-9]*\.[0-9]*\.[0-9]*)\"", version), \ - ("ICE_INT_VERSION ([0-9]*)", intVersion(version))]) + [("ICE_STRING_VERSION \"" + vpatMatch + "\"", version), \ + ("ICE_INT_VERSION ([0-9]*)", intVersion(version))]) fileMatchAndReplace(os.path.join(ice_home, "config", "Make.rules"), [("VERSION_MAJOR[\t\s]*= ([0-9]*)", majorVersion(version)), - ("VERSION_MINOR[\t\s]*= ([0-9]*)", minorVersion(version)), - ("VERSION_PATCH[\t\s]*= ([0-9]*)", patchVersion(version))]) + ("VERSION_MINOR[\t\s]*= ([0-9]*)", minorVersion(version)), + ("VERSION[\t\s]*= " + vpatMatch, version), + ("SOVERSION[\t\s]*= ([0-9]+b?)", soVersion(version))]) + fileMatchAndReplace(os.path.join(ice_home, "config", "Make.rules.mak"), - [("VERSION[\t\s]*= ([0-9]*\.[0-9]*\.[0-9]*)", version), - ("SOVERSION[\t\s]*= ([0-9]*)", soVersion(version))]) + [("VERSION[\t\s]*= " + vpatMatch, version), + ("SOVERSION[\t\s]*= ([0-9]+b?)", soVersion(version))]) fileMatchAndReplace(os.path.join(ice_home, "src", "ca", "iceca"), - [("Ice-([0-9]*\.[0-9]*\.[0-9]*)", version)]) + [("Ice-" + vpatMatch, version)]) fileMatchAndReplace(os.path.join(ice_home, "demo", "IceStorm", "clock", "config.icebox"), - [("IceStormService,([0-9]*[0-9]*)", soVersion(version))]) + [("IceStormService,([0-9]+b?)", soVersion(version))]) fileMatchAndReplace(os.path.join(ice_home, "demo", "IceStorm", "counter", "config.icebox"), - [("IceStormService,([0-9]*[0-9]*)", soVersion(version))]) + [("IceStormService,([0-9]+b?)", soVersion(version))]) + + fileMatchAndReplace(os.path.join(ice_home, "config", "templates.xml"), + [("IceStormService,([0-9]+b?)", soVersion(version))]) + # # Fix version in IceJ sources # icej_home = findSourceTree("icej", os.path.join("src", "IceUtil", "Version.java")) if icej_home: fileMatchAndReplace(os.path.join(icej_home, "src", "IceUtil", "Version.java"), - [("ICE_STRING_VERSION = \"([0-9]*\.[0-9]*\.[0-9]*)\"", version), \ + [("ICE_STRING_VERSION = \"" + vpatMatch +"\"", version), \ ("ICE_INT_VERSION = ([0-9]*)", intVersion(version))]) fileMatchAndReplace(os.path.join(icej_home, "demo", "IceStorm", "clock", "config.icebox"), - [("IceStormService,([0-9]*[0-9]*)", soVersion(version))]) + [("IceStormService,([0-9]+b?)", soVersion(version))]) # # Fix version in IceCS sources @@ -225,62 +263,69 @@ if not patchIceE: if icecs_home: for f in find(icecs_home, "AssemblyInfo.cs"): if f.find("generate") < 0 and f.find("ConsoleApplication") < 0: - fileMatchAndReplace(f, [("AssemblyVersion\(\"([0-9]*\.[0-9]*\.[0-9]*)\"\)", version)]) + fileMatchAndReplace(f, [("AssemblyVersion\(\"" + vpatMatch + "\"", + majorVersion(version) + "." + minorVersion(version) + "." + patchVersion(version))]) fileMatchAndReplace(os.path.join(icecs_home, "config", "Make.rules.cs"), - [("VERSION[\t\s]*= ([0-9]*\.[0-9]*\.[0-9]*)", version)]) + [("VERSION[\t\s]*= " + vpatMatch, version)]) fileMatchAndReplace(os.path.join(icecs_home, "config", "Make.rules.mak"), - [("VERSION[\t\s]*= ([0-9]*\.[0-9]*\.[0-9]*)", version)]) + [("VERSION[\t\s]*= " + vpatMatch, version)]) fileMatchAndReplace(os.path.join(icecs_home, "config", "makeconfig.py"), - [("version=*\"([0-9]*\.[0-9]*\.[0-9]*).0\"", version)]) + [("version=*\"([0-9]*\.[0-9]*\.[0-9]*).0\"", + majorVersion(version) + "." + minorVersion(version) + "." + patchVersion(version))]) cmd = "chmod 770 " + os.path.join(icecs_home, "config", "makeconfig.py") os.system(cmd) fileMatchAndReplace(os.path.join(icecs_home, "demo", "IceStorm", "clock", "config.icebox"), - [("IceStormService,([0-9]*[0-9]*)", soVersion(version))]) + [("IceStormService,([0-9]+b?)", soVersion(version))]) for f in find(icecs_home, "*.pc"): - fileMatchAndReplace(f, [("[\t\s]*version[\t\s]*=[\t\s]*([0-9]*\.[0-9]*\.[0-9]*)", version)]) + fileMatchAndReplace(f, [("[\t\s]*version[\t\s]*=[\t\s]*" + vpatMatch, version)]) # - # Fix version in IceCS sources + # Fix version in IceVB sources # icevb_home = findSourceTree("icevb", os.path.join("generate", "Generate.vb")) if icevb_home: fileMatchAndReplace(os.path.join(icevb_home, "config", "Make.rules.mak"), - [("VERSION[\t\s]*= ([0-9]*\.[0-9]*\.[0-9]*)", version)]) + [("VERSION[\t\s]*= " + vpatMatch, version)]) fileMatchAndReplace(os.path.join(icevb_home, "demo", "IceStorm", "clock", "config.icebox"), - [("IceStormService,([0-9]*[0-9]*)", soVersion(version))]) + [("IceStormService,([0-9]+b?)", soVersion(version))]) # # Fix version in IcePHP # - icephp_home = findSourceTree("icephp", os.path.join("src", "ice", "php_ice.h")) + icephp_home = findSourceTree("icephp", os.path.join("config", "Make.rules")) if icephp_home: - fileMatchAndReplace(os.path.join(icephp_home, "src", "ice", "php_ice.h"), - [("ICEPHP_STRING_VERSION \"([0-9]*\.[0-9]*\.[0-9]*)\"", version), \ - ("ICEPHP_INT_VERSION ([0-9]*)", intVersion(version))]) + fileMatchAndReplace(os.path.join(icephp_home, "config", "Make.rules"), + [("VERSION_MAJOR[\t\s]*= ([0-9]*)", majorVersion(version)), + ("VERSION_MINOR[\t\s]*= ([0-9]*)", minorVersion(version)), + ("VERSION[\t\s]*= " + vpatMatch, version), + ("SOVERSION[\t\s]*= ([0-9]+b?)", soVersion(version))]) + + fileMatchAndReplace(os.path.join(icephp_home, "config", "Make.rules.mak"), + [("VERSION[\t\s]*= " + vpatMatch, version), + ("SOVERSION[\t\s]*= ([0-9]+b?)", soVersion(version))]) + + print "Please update icephp/src/IcePHP/Profile.cpp: too difficult to parse!" # # Fix version in IcePy # icepy_home = findSourceTree("icepy", os.path.join("modules", "IcePy", "Config.h")) if icepy_home: - fileMatchAndReplace(os.path.join(icepy_home, "config", "Make.rules"), - [("VERSION_MAJOR[\t\s]*= ([0-9]*)", majorVersion(version)), - ("VERSION_MINOR[\t\s]*= ([0-9]*)", minorVersion(version)), - ("VERSION_PATCH[\t\s]*= ([0-9]*)", patchVersion(version))]) - - fileMatchAndReplace(os.path.join(icepy_home, "config", "Make.rules.mak"), + fileMatchAndReplace(os.path.join(icepy_home, "config", "Make.rules"), [("VERSION_MAJOR[\t\s]*= ([0-9]*)", majorVersion(version)), - ("VERSION_MINOR[\t\s]*= ([0-9]*)", minorVersion(version)), - ("VERSION_PATCH[\t\s]*= ([0-9]*)", patchVersion(version))]) + ("VERSION_MINOR[\t\s]*= ([0-9]*)", minorVersion(version)), + ("VERSION[\t\s]*= " + vpatMatch, version), + ("SOVERSION[\t\s]*= ([0-9]+b?)", soVersion(version))]) - fileMatchAndReplace(os.path.join(icepy_home, "demo", "IceStorm", "clock", "config.icebox"), - [("IceStormService,([0-9]*[0-9]*)", soVersion(version))]) + fileMatchAndReplace(os.path.join(icepy_home, "config", "Make.rules.mak"), + [("VERSION[\t\s]*= " + vpatMatch, version), + ("SOVERSION[\t\s]*= ([0-9]+b?)", soVersion(version))]) # # Fix version in IceRuby @@ -288,13 +333,12 @@ if not patchIceE: icerb_home = findSourceTree("icerb", os.path.join("src", "IceRuby", "Config.h")) if icerb_home: fileMatchAndReplace(os.path.join(icerb_home, "config", "Make.rules"), - [("VERSION[\t\s]*= ([0-9]*\.[0-9]*\.[0-9]*)", version), - ("SOVERSION[\t\s]*= ([0-9]*)", soVersion(version))]) + [("VERSION[\t\s]*= " + vpatMatch, version), + ("SOVERSION[\t\s]*= ([0-9]+b?)", soVersion(version))]) - fileMatchAndReplace(os.path.join(icerb_home, "config", "Make.rules.mak"), - [("VERSION_MAJOR[\t\s]*= ([0-9]*)", majorVersion(version)), - ("VERSION_MINOR[\t\s]*= ([0-9]*)", minorVersion(version)), - ("VERSION_PATCH[\t\s]*= ([0-9]*)", patchVersion(version))]) + fileMatchAndReplace(os.path.join(icerb_home, "config", "Make.rules.mak"), + [("VERSION[\t\s]*= " + vpatMatch, version), + ("SOVERSION[\t\s]*= ([0-9]+b?)", soVersion(version))]) print "Running 'make config' in IceCS" os.chdir(icecs_home) diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h index 44765234b84..852b5603300 100644 --- a/cpp/include/IceUtil/Config.h +++ b/cpp/include/IceUtil/Config.h @@ -206,7 +206,7 @@ typedef long long Int64; // // The Ice version. // -#define ICE_STRING_VERSION "3.2.0" // "A.B.C", with A=major, B=minor, C=patch -#define ICE_INT_VERSION 30200 // AABBCC, with AA=major, BB=minor, CC=patch +#define ICE_STRING_VERSION "3.2b" // "A.B.C", with A=major, B=minor, C=patch +#define ICE_INT_VERSION 30251 // AABBCC, with AA=major, BB=minor, CC=patch #endif diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp index 9ac4422a950..d1b25c1a46c 100644 --- a/cpp/src/Ice/DynamicLibrary.cpp +++ b/cpp/src/Ice/DynamicLibrary.cpp @@ -70,7 +70,17 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc int minorVersion = (ICE_INT_VERSION / 100) - majorVersion * 100; ostringstream os; os << majorVersion * 10 + minorVersion; - version = os.str(); + + int patchVersion = ICE_INT_VERSION % 100; + if(patchVersion > 50) + { + os << 'b'; + if(patchVersion >= 52) + { + os << (patchVersion - 50); + } + } + version = os.str(); } } else diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp index ec31d9b7226..cb7252ddf94 100644 --- a/cpp/src/Ice/Initialize.cpp +++ b/cpp/src/Ice/Initialize.cpp @@ -108,6 +108,17 @@ Ice::createProperties(int& argc, char* argv[], const PropertiesPtr& defaults, co inline void checkIceVersion(Int version) { #ifndef ICE_IGNORE_VERSION + +# if ICE_INT_VERSION % 100 > 50 + // + // Beta version: exact match required + // + if(ICE_INT_VERSION != version) + { + throw VersionMismatchException(__FILE__, __LINE__); + } +# else + // // Major and minor version numbers must match. // @@ -115,6 +126,15 @@ inline void checkIceVersion(Int version) { throw VersionMismatchException(__FILE__, __LINE__); } + + // + // Reject beta caller + // + if(version % 100 > 50) + { + throw VersionMismatchException(__FILE__, __LINE__); + } + // // The caller's patch level cannot be greater than library's patch level. (Patch level changes are // backward-compatible, but not forward-compatible.) @@ -123,6 +143,8 @@ inline void checkIceVersion(Int version) { throw VersionMismatchException(__FILE__, __LINE__); } + +# endif #endif } diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp index bef622075e1..b4f9d48f8d0 100644 --- a/cpp/src/Slice/CPlusPlusUtil.cpp +++ b/cpp/src/Slice/CPlusPlusUtil.cpp @@ -99,12 +99,32 @@ Slice::printVersionCheck(Output& out) { out << "\n"; out << "\n#ifndef ICE_IGNORE_VERSION"; - out << "\n# if ICE_INT_VERSION / 100 != " << ICE_INT_VERSION / 100; - out << "\n# error Ice version mismatch!"; - out << "\n# endif"; - out << "\n# if ICE_INT_VERSION % 100 < " << ICE_INT_VERSION % 100; - out << "\n# error Ice patch level mismatch!"; - out << "\n# endif"; + if(ICE_INT_VERSION % 100 > 50) + { + // + // Beta version: exact match required + // + out << "\n# if ICE_INT_VERSION != " << ICE_INT_VERSION; + out << "\n# error Ice version mismatch: an exact match is required for beta generated code"; + out << "\n# endif"; + } + else + { + out << "\n# if ICE_INT_VERSION / 100 != " << ICE_INT_VERSION / 100; + out << "\n# error Ice version mismatch!"; + out << "\n# endif"; + + // + // Generated code is release; reject beta header + // + out << "\n# if ICE_INT_VERSION % 100 > 50"; + out << "\n# error Beta header file detected"; + out << "\n# endif"; + + out << "\n# if ICE_INT_VERSION % 100 < " << ICE_INT_VERSION % 100; + out << "\n# error Ice patch level mismatch!"; + out << "\n# endif"; + } out << "\n#endif"; } diff --git a/cpp/src/ca/iceca b/cpp/src/ca/iceca index 1d11213724d..56245e1753b 100755 --- a/cpp/src/ca/iceca +++ b/cpp/src/ca/iceca @@ -71,7 +71,7 @@ if sys.argv[script] == "import": # handles standard tarball installs. # for bindir in [os.path.dirname(sys.argv[0]), os.path.join(os.getenv("ICE_HOME"), "bin"), ".", "/usr/bin", \ - "/opt/Ice-3.2.0/bin"]: + "/opt/Ice-3.2b/bin"]: bindir = os.path.normpath(bindir) if os.path.exists(os.path.join(bindir, "ImportKey.class")): break |