fix broken backwards compatibility
authorAleš Křenek <ljocha@ics.muni.cz>
Fri, 19 Nov 2004 13:03:23 +0000 (13:03 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Fri, 19 Nov 2004 13:03:23 +0000 (13:03 +0000)
org.glite.lb.client-interface/Makefile
org.glite.lb.client-interface/interface/context.h
org.glite.lb.client-interface/project/version.properties
org.glite.lb.common/Makefile
org.glite.lb.common/project/version.properties
org.glite.lb.common/src/context.c
org.glite.lb.common/src/param.c

index 9e315b7..b1632b9 100644 (file)
@@ -21,7 +21,7 @@ STAGETO=include/${globalprefix}/${lbprefix}
 STATIC_H=consumer.h context.h dump.h load.h notification.h notifid.h purge.h \
        Notification.h CountRef.h Job.h LoggingExceptions.h ServerConnection.h \
        consumer_fake.h producer_fake.h
-GEN_H=events.h jobstat.h producer.h Event.h JobStatus.h
+GEN_H=events.h jobstat.h producer.h Event.h JobStatus.h interface_version.h
 
 
 generate: ${GEN_H}
@@ -36,6 +36,8 @@ check:
        ${AT3} $< >$@ || rm -f $@
        chmod -w $@ >/dev/null
 
+interface_version.h: ${top_srcdir}/project/version.properties
+       echo "#define GLITE_LB_CLIENT_INTERFACE \"${version}\"" >$@ 
 stage: generate
        $(MAKE) install PREFIX=${top_srcdir}/${stagedir}
 
index 5ae223c..5f176d5 100644 (file)
@@ -39,12 +39,12 @@ typedef enum _edg_wll_ContextParam {
        EDG_WLL_PARAM_NOTIF_SERVER,     /**< default notification server name */
        EDG_WLL_PARAM_NOTIF_SERVER_PORT,/**< default notification server port */
        EDG_WLL_PARAM_NOTIF_TIMEOUT,    /**< notif timeout */
-       EDG_WLL_PARAM_LBPROXY_STORE_SOCK,/**< lbproxy store socket path */
-       EDG_WLL_PARAM_LBPROXY_SERVE_SOCK,/**<  lbproxy serve socket path */
-       EDG_WLL_PARAM_LBPROXY_USER,     /**< user credentials when logging to L&B Proxy */
        EDG_WLL_PARAM_X509_PROXY,       /**< proxy file to use for authentication */
        EDG_WLL_PARAM_X509_KEY,         /**< key file to use for authentication */
        EDG_WLL_PARAM_X509_CERT,        /**< certificate file to use for authentication */
+       EDG_WLL_PARAM_LBPROXY_STORE_SOCK,/**< lbproxy store socket path */
+       EDG_WLL_PARAM_LBPROXY_SERVE_SOCK,/**<  lbproxy serve socket path */
+       EDG_WLL_PARAM_LBPROXY_USER,     /**< user credentials when logging to L&B Proxy */
        EDG_WLL_PARAM__LAST,            /**< marker, LB internal use only */
 } edg_wll_ContextParam;
 
@@ -133,8 +133,7 @@ typedef enum _edg_wll_ErrorCode {
        EDG_WLL_ERROR_PARSE_MSG_INCOMPLETE, /**< Incomplete message (missing fields) */
        EDG_WLL_ERROR_PARSE_KEY_DUPLICITY, /**< Duplicate entry in message */
        EDG_WLL_ERROR_PARSE_KEY_MISUSE, /**< Entry not allowed for this message type */
-       EDG_WLL_ERROR_PARSE_OK_WITH_EXTRA_FIELDS, /**< Additional, not understood fields found in message */
-       EDG_WLL_ERROR_COMPARE_EVENTS, /**< Two compared events differ.
+       EDG_WLL_ERROR_PARSE_OK_WITH_EXTRA_FIELDS, /**< Additional, not understood fields found in message.
                The rest is OK therefore this is not a true error. */
         EDG_WLL_ERROR_XML_PARSE, /**< Error in parsing XML protocol. */
         EDG_WLL_ERROR_SERVER_RESPONSE, /**< Generic failure on server. See syslog on the server machine for details. */
@@ -144,12 +143,13 @@ typedef enum _edg_wll_ErrorCode {
        EDG_WLL_ERROR_URL_FORMAT, /**< Malformed URL */
        EDG_WLL_ERROR_MD5_CLASH, /**< MD5 hash same for different strings. Very unlikely :-). */
        EDG_WLL_ERROR_GSS, /**< Generic GSSAPI error. See errDesc returned by edg_wll_Error(). */
+       EDG_WLL_ERROR_DNS, /**< DNS resolver error. See errDesc returned by edg_wll_Error(). */
        EDG_WLL_ERROR_NOJOBID,  /**< Attmepted call requires calling edg_wll_SetLoggingJob() first. */
        EDG_WLL_ERROR_NOINDEX,  /**< Query does not contain any conidion on indexed attribute. */
        EDG_WLL_IL_PROTO,       /**< Interlogger to lbserver communication protocol error. */
        EDG_WLL_IL_SYS,         /**< Interlogger internal error. */
        EDG_WLL_IL_EVENTS_WAITING, /**< Interlogger still has events pending delivery. */
-       EDG_WLL_ERROR_DNS, /**< DNS resolver error. See errDesc returned by edg_wll_Error(). */
+       EDG_WLL_ERROR_COMPARE_EVENTS, /**< Two compared events differ. */
 } edg_wll_ErrorCode;
 
 /**
index 57663b5..09f0387 100644 (file)
@@ -1,4 +1,3 @@
-#Fri Nov 19 05:47:05 CET 2004
-module.version=0.2.0
+module.version=0.3.0
 module.build=88
 module.age=2
index fac925e..ccbc4b4 100644 (file)
@@ -40,6 +40,13 @@ CFLAGS:=${DEBUG} -I${top_srcdir}/src -I${top_srcdir}/interface \
        ${COVERAGE_FLAGS} \
        -DDATAGRID_EXTENSION
 
+# We must follow major version changes of org.glite.lb.client-interface due to
+# binary compatibility. However, we may live a life of our own, changing our
+# major version more frequently. This variable specifies how many steps ahead
+# we are.
+
+VERSION_AHEAD=0
+
 GLOBUS_LIBS:=-L${globus_prefix}/lib \
         -lglobus_common_${nothrflavour} \
         -lglobus_gssapi_gsi_${nothrflavour} \
@@ -86,7 +93,9 @@ THRLTLIB:=libglite_lb_common_${thrflavour}.la
 
 default: all
 
-all compile: ${STATICLIB} ${LTLIB} ${THRSTATICLIB} ${THRLTLIB}
+all compile: check_version ${STATICLIB} ${LTLIB} ${THRSTATICLIB} ${THRLTLIB}
+
+version_info=-version-info `echo ${version} | cut -d. -f1,2 | tr . :`
 
 ${STATICLIB}: ${OBJS}
        ar crv $@ ${OBJS}
@@ -97,12 +106,12 @@ ${THRSTATICLIB}: ${THROBJS}
        ranlib $@
 
 ${LTLIB}: ${OBJS}
-       ${LINK} -o $@ ${LOBJS} \
+       ${LINK} ${version_info} -o $@ ${LOBJS} \
                -lglite_wmsutils_cjobid \
                -lm
 
 ${THRLTLIB}: ${THROBJS}
-       ${LINK} -o $@ ${THRLOBJS} \
+       ${LINK} ${version_info} -o $@ ${THRLOBJS} \
                -lglite_wmsutils_cjobid \
                -lm
 
@@ -190,3 +199,13 @@ il_int_test.o il_string_test.o il_test.o: %.o: %.cpp
        rm -f $@
        ${AT3} $< >$@ || rm -f $@
        chmod -w $@ >/dev/null
+
+check_version:
+       @perl -ne '/#define GLITE_LB_CLIENT_INTERFACE "(\d+)\.\d+\.\d+"/; \
+               $$iface=$$1; \
+               $$_="${version}"; /(\d+)\.\d+\.\d+/; \
+               if ($$iface + ${VERSION_AHEAD} != $$1) { \
+                       print "error: Major version of the interface ($$iface+${VERSION_AHEAD}) does not match implementation ($$1)\n" ;\
+                       exit 1;  \
+               } \
+               ' ${stagedir}/include/glite/lb/interface_version.h
index 891543a..ebd17f9 100644 (file)
@@ -1,4 +1,4 @@
-#Fri Nov 19 05:48:41 CET 2004
-module.version=0.2.0
+#Thu Nov 18 05:46:55 CET 2004
+module.version=0.3.0
 module.build=87
 module.age=2
index 43d595e..504022d 100644 (file)
@@ -100,7 +100,6 @@ static const char* const errTexts[] = {
        "Duplicate ULM key",
        "Misuse of ULM key",
        "Warning: extra ULM fields",
-       "Compared events differ",
        "XML Parse error",
        "Server response error",
        "Bad JobId format",
@@ -108,12 +107,13 @@ static const char* const errTexts[] = {
        "Bad URL format",
        "MD5 key clash",
        "GSSAPI Error",
+       "DNS resolver error",
        "No JobId specified in context",
        "No indexed condition in query",
        "Interlogger protocol error",
        "Interlogger internal error",
-       "Interlogger has events pending"
-       "DNS resolver error",
+       "Interlogger has events pending",
+       "Compared events differ",
 };
 
 const char *edg_wll_GetErrorText(int code) {
index 89bb0a5..2efd560 100644 (file)
@@ -34,13 +34,13 @@ static const char *myenv[] = {
        "EDG_WL_NOTIF_SERVER",
        "EDG_WL_NOTIF_SERVER",
        "EDG_WL_NOTIF_TIMEOUT",
-       "EDG_WL_LBPROXY_STORE_SOCK",
-       "EDG_WL_LBPROXY_SERVE_SOCK",
-       "EDG_WL_LBPROXY_USER",
 /* don't care about X509_USER_*, GSI looks at them anyway */
        NULL,
        NULL,
        NULL,
+       "EDG_WL_LBPROXY_STORE_SOCK",
+       "EDG_WL_LBPROXY_SERVE_SOCK",
+       "EDG_WL_LBPROXY_USER",
 };
 
 /* XXX: does not parse URL, just hostname[:port] */