subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1502267 - in /subversion/trunk/subversion: include/ libsvn_fs_base/ libsvn_fs_fs/ libsvn_ra_local/ libsvn_ra_serf/ libsvn_ra_svn/ libsvn_subr/ svn/ svnadmin/ svndumpfilter/ svnlook/ svnmucc/ svnserve/ svnsync/ svnversion/
Date Thu, 11 Jul 2013 16:19:04 GMT
Author: danielsh
Date: Thu Jul 11 16:19:04 2013
New Revision: 1502267

URL: http://svn.apache.org/r1502267
Log:
Enforce our standing policy that the cmdline tools and all libraries must be
upgraded in lockstep: fail the library version check if any of the dependency
libraries are not exactly the same version as the calling library or binary.

* subversion/include/svn_version.h
  (svn_ver_check_list): Deprecate.
  (svn_ver_check_list2): New.
  (svn_ver_equal, svn_ver_compatible):
    Document their use in svn_ver_check_list2().

* subversion/libsvn_subr/deprecated.c
* subversion/libsvn_subr/version.c
  (svn_ver_check_list): New deprecated wrapper.
  (svn_ver_check_list2): Implement.

* subversion/libsvn_fs_base/fs.c
  (svn_fs_base__init):
* subversion/libsvn_fs_fs/fs.c
  (svn_fs_fs__init):
* subversion/libsvn_ra_local/ra_plugin.c
  (svn_ra_local__init):
* subversion/libsvn_ra_serf/serf.c
  (svn_ra_serf__init):
* subversion/libsvn_ra_svn/client.c
  (svn_ra_svn__init):
* subversion/libsvn_subr/auth.c
  (svn_auth_get_platform_specific_provider):
* subversion/svn/svn.c
  (check_lib_versions):
* subversion/svnadmin/svnadmin.c
  (check_lib_versions):
* subversion/svnadmin/svnadmin.c
  (check_lib_versions):
* subversion/svnadmin/svnadmin.c
  (check_lib_versions):
* subversion/svndumpfilter/svndumpfilter.c
  (check_lib_versions):
* subversion/svnlook/svnlook.c
  (check_lib_versions):
* subversion/svnmucc/svnmucc.c
  (init):
* subversion/svnserve/svnserve.c
  (check_lib_versions):
* subversion/svnsync/svnsync.c
  (check_lib_versions):
* subversion/svnversion/svnversion.c
  (check_lib_versions):
    Update callers.

Modified:
    subversion/trunk/subversion/include/svn_version.h
    subversion/trunk/subversion/libsvn_fs_base/fs.c
    subversion/trunk/subversion/libsvn_fs_fs/fs.c
    subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
    subversion/trunk/subversion/libsvn_ra_serf/serf.c
    subversion/trunk/subversion/libsvn_ra_svn/client.c
    subversion/trunk/subversion/libsvn_subr/auth.c
    subversion/trunk/subversion/libsvn_subr/deprecated.c
    subversion/trunk/subversion/libsvn_subr/version.c
    subversion/trunk/subversion/svn/svn.c
    subversion/trunk/subversion/svnadmin/svnadmin.c
    subversion/trunk/subversion/svndumpfilter/svndumpfilter.c
    subversion/trunk/subversion/svnlook/svnlook.c
    subversion/trunk/subversion/svnmucc/svnmucc.c
    subversion/trunk/subversion/svnserve/svnserve.c
    subversion/trunk/subversion/svnsync/svnsync.c
    subversion/trunk/subversion/svnversion/svnversion.c

Modified: subversion/trunk/subversion/include/svn_version.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_version.h?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_version.h (original)
+++ subversion/trunk/subversion/include/svn_version.h Thu Jul 11 16:19:04 2013
@@ -192,6 +192,8 @@ struct svn_version_t
  * unreleased library. A development client is always compatible with
  * a previous released library.
  *
+ * @note Implements the #svn_ver_check_list2.@a comparator interface.
+ *
  * @since New in 1.1.
  */
 svn_boolean_t
@@ -201,6 +203,8 @@ svn_ver_compatible(const svn_version_t *
 /**
  * Check if @a my_version and @a lib_version encode the same version number.
  *
+ * @note Implements the #svn_ver_check_list2.@a comparator interface.
+ *
  * @since New in 1.2.
  */
 svn_boolean_t
@@ -228,10 +232,31 @@ typedef struct svn_version_checklist_t
  * my_version is compatible with each entry in @a checklist. @a
  * checklist must end with an entry whose label is @c NULL.
  *
- * @see svn_ver_compatible()
+ * @a my_version is considered to be compatible with a version in @a checklist
+ * if @a comparator returns #TRUE when called with @a my_version as the first
+ * parammeter and the @a checklist version as the second parameter.
+ *
+ * @see svn_ver_compatible(), svn_ver_equal()
+ *
+ * @note Subversion's own code invariably uses svn_ver_equal() as @a comparator,
+ * since the cmdline tools sometimes use non-public APIs (such as utility
+ * functions that haven't been promoted to svn_cmdline.h).  Third-party code
+ * SHOULD use svn_ver_compatible() as @a comparator.
  *
- * @since New in 1.1.
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_ver_check_list2(const svn_version_t *my_version,
+                    const svn_version_checklist_t *checklist,
+                    svn_boolean_t (*comparator)(const svn_version_t *,
+                                                const svn_version_t *));
+
+/** Similar to svn_ver_check_list2(), with @a comparator set to
+ * #svn_ver_compatible.
+ *
+ * @deprecated Provided for backward compatibility with 1.8 API.
  */
+SVN_DEPRECATED
 svn_error_t *
 svn_ver_check_list(const svn_version_t *my_version,
                    const svn_version_checklist_t *checklist);

Modified: subversion/trunk/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/fs.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_base/fs.c Thu Jul 11 16:19:04 2013
@@ -1493,7 +1493,7 @@ svn_fs_base__init(const svn_version_t *l
     return svn_error_createf(SVN_ERR_VERSION_MISMATCH, NULL,
                              _("Unsupported FS loader version (%d) for bdb"),
                              loader_version->major);
-  SVN_ERR(svn_ver_check_list(base_version(), checklist));
+  SVN_ERR(svn_ver_check_list2(base_version(), checklist, svn_ver_equal));
   SVN_ERR(check_bdb_version());
   SVN_ERR(svn_fs_bdb__init(common_pool));
 

Modified: subversion/trunk/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs.c Thu Jul 11 16:19:04 2013
@@ -484,7 +484,7 @@ svn_fs_fs__init(const svn_version_t *loa
     return svn_error_createf(SVN_ERR_VERSION_MISMATCH, NULL,
                              _("Unsupported FS loader version (%d) for fsfs"),
                              loader_version->major);
-  SVN_ERR(svn_ver_check_list(fs_version(), checklist));
+  SVN_ERR(svn_ver_check_list2(fs_version(), checklist, svn_ver_equal));
 
   *vtable = &library_vtable;
   return SVN_NO_ERROR;

Modified: subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c Thu Jul 11 16:19:04 2013
@@ -1764,7 +1764,7 @@ svn_ra_local__init(const svn_version_t *
                                "ra_local"),
                              loader_version->major);
 
-  SVN_ERR(svn_ver_check_list(ra_local_version(), checklist));
+  SVN_ERR(svn_ver_check_list2(ra_local_version(), checklist, svn_ver_equal));
 
 #ifndef SVN_LIBSVN_CLIENT_LINKS_RA_LOCAL
   /* This assumes that POOL was the pool used to load the dso. */

Modified: subversion/trunk/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_serf/serf.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/trunk/subversion/libsvn_ra_serf/serf.c Thu Jul 11 16:19:04 2013
@@ -1239,7 +1239,7 @@ svn_ra_serf__init(const svn_version_t *l
   int serf_minor;
   int serf_patch;
 
-  SVN_ERR(svn_ver_check_list(ra_serf_version(), checklist));
+  SVN_ERR(svn_ver_check_list2(ra_serf_version(), checklist, svn_ver_equal));
 
   /* Simplified version check to make sure we can safely use the
      VTABLE parameter. The RA loader does a more exhaustive check. */

Modified: subversion/trunk/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_svn/client.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/trunk/subversion/libsvn_ra_svn/client.c Thu Jul 11 16:19:04 2013
@@ -2730,7 +2730,7 @@ svn_ra_svn__init(const svn_version_t *lo
       { NULL, NULL }
     };
 
-  SVN_ERR(svn_ver_check_list(svn_ra_svn_version(), checklist));
+  SVN_ERR(svn_ver_check_list2(svn_ra_svn_version(), checklist, svn_ver_equal));
 
   /* Simplified version check to make sure we can safely use the
      VTABLE parameter. The RA loader does a more exhaustive check. */

Modified: subversion/trunk/subversion/libsvn_subr/auth.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/auth.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/auth.c (original)
+++ subversion/trunk/subversion/libsvn_subr/auth.c Thu Jul 11 16:19:04 2013
@@ -481,7 +481,8 @@ svn_auth_get_platform_specific_provider(
               check_list[0].version_query = version_function;
               check_list[1].label = NULL;
               check_list[1].version_query = NULL;
-              SVN_ERR(svn_ver_check_list(svn_subr_version(), check_list));
+              SVN_ERR(svn_ver_check_list2(svn_subr_version(), check_list,
+                                          svn_ver_equal));
             }
           if (apr_dso_sym(&provider_function_symbol,
                           dso,

Modified: subversion/trunk/subversion/libsvn_subr/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/deprecated.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_subr/deprecated.c Thu Jul 11 16:19:04 2013
@@ -1301,4 +1301,10 @@ svn_subst_build_keywords(svn_subst_keywo
   return SVN_NO_ERROR;
 }
 
-
+/*** From version.c ***/
+svn_error_t *
+svn_ver_check_list(const svn_version_t *my_version,
+                   const svn_version_checklist_t *checklist)
+{
+  return svn_ver_check_list2(my_version, checklist, svn_ver_compatible);
+}

Modified: subversion/trunk/subversion/libsvn_subr/version.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/version.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/version.c (original)
+++ subversion/trunk/subversion/libsvn_subr/version.c Thu Jul 11 16:19:04 2013
@@ -75,8 +75,10 @@ svn_boolean_t svn_ver_equal(const svn_ve
 
 
 svn_error_t *
-svn_ver_check_list(const svn_version_t *my_version,
-                   const svn_version_checklist_t *checklist)
+svn_ver_check_list2(const svn_version_t *my_version,
+                    const svn_version_checklist_t *checklist,
+                    svn_boolean_t (*comparator)(const svn_version_t *,
+                                                const svn_version_t *))
 {
   svn_error_t *err = SVN_NO_ERROR;
   int i;
@@ -84,12 +86,17 @@ svn_ver_check_list(const svn_version_t *
   for (i = 0; checklist[i].label != NULL; ++i)
     {
       const svn_version_t *lib_version = checklist[i].version_query();
-      if (!svn_ver_compatible(my_version, lib_version))
+      if (!comparator(my_version, lib_version))
         err = svn_error_createf(SVN_ERR_VERSION_MISMATCH, err,
-                                _("Version mismatch in '%s':"
+                                _("Version mismatch in '%s'%s:"
                                   " found %d.%d.%d%s,"
                                   " expected %d.%d.%d%s"),
                                 checklist[i].label,
+                                comparator == svn_ver_equal
+                                ? _(" (expecting equality)")
+                                : comparator == svn_ver_compatible
+                                ? _(" (expecting compatibility)")
+                                : "",
                                 lib_version->major, lib_version->minor,
                                 lib_version->patch, lib_version->tag,
                                 my_version->major, my_version->minor,

Modified: subversion/trunk/subversion/svn/svn.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/svn.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/svn.c (original)
+++ subversion/trunk/subversion/svn/svn.c Thu Jul 11 16:19:04 2013
@@ -1658,7 +1658,7 @@ check_lib_versions(void)
     };
   SVN_VERSION_DEFINE(my_version);
 
-  return svn_ver_check_list(&my_version, checklist);
+  return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
 }
 
 

Modified: subversion/trunk/subversion/svnadmin/svnadmin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/svnadmin.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/svnadmin/svnadmin.c (original)
+++ subversion/trunk/subversion/svnadmin/svnadmin.c Thu Jul 11 16:19:04 2013
@@ -141,7 +141,7 @@ check_lib_versions(void)
     };
   SVN_VERSION_DEFINE(my_version);
 
-  return svn_ver_check_list(&my_version, checklist);
+  return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
 }
 
 

Modified: subversion/trunk/subversion/svndumpfilter/svndumpfilter.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svndumpfilter/svndumpfilter.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/svndumpfilter/svndumpfilter.c (original)
+++ subversion/trunk/subversion/svndumpfilter/svndumpfilter.c Thu Jul 11 16:19:04 2013
@@ -1176,7 +1176,7 @@ check_lib_versions(void)
     };
   SVN_VERSION_DEFINE(my_version);
 
-  return svn_ver_check_list(&my_version, checklist);
+  return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
 }
 
 

Modified: subversion/trunk/subversion/svnlook/svnlook.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnlook/svnlook.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/svnlook/svnlook.c (original)
+++ subversion/trunk/subversion/svnlook/svnlook.c Thu Jul 11 16:19:04 2013
@@ -397,7 +397,7 @@ check_lib_versions(void)
     };
   SVN_VERSION_DEFINE(my_version);
 
-  return svn_ver_check_list(&my_version, checklist);
+  return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
 }
 
 

Modified: subversion/trunk/subversion/svnmucc/svnmucc.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnmucc/svnmucc.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/svnmucc/svnmucc.c (original)
+++ subversion/trunk/subversion/svnmucc/svnmucc.c Thu Jul 11 16:19:04 2013
@@ -85,7 +85,7 @@ init(const char *application)
   if (svn_cmdline_init(application, stderr))
     exit(EXIT_FAILURE);
 
-  err = svn_ver_check_list(&my_version, checklist);
+  err = svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
   if (err)
     handle_error(err, NULL);
 

Modified: subversion/trunk/subversion/svnserve/svnserve.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/svnserve.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/svnserve/svnserve.c (original)
+++ subversion/trunk/subversion/svnserve/svnserve.c Thu Jul 11 16:19:04 2013
@@ -465,7 +465,7 @@ check_lib_versions(void)
     };
   SVN_VERSION_DEFINE(my_version);
 
-  return svn_ver_check_list(&my_version, checklist);
+  return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
 }
 
 

Modified: subversion/trunk/subversion/svnsync/svnsync.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnsync/svnsync.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/svnsync/svnsync.c (original)
+++ subversion/trunk/subversion/svnsync/svnsync.c Thu Jul 11 16:19:04 2013
@@ -312,7 +312,7 @@ check_lib_versions(void)
     };
   SVN_VERSION_DEFINE(my_version);
 
-  return svn_ver_check_list(&my_version, checklist);
+  return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
 }
 
 

Modified: subversion/trunk/subversion/svnversion/svnversion.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnversion/svnversion.c?rev=1502267&r1=1502266&r2=1502267&view=diff
==============================================================================
--- subversion/trunk/subversion/svnversion/svnversion.c (original)
+++ subversion/trunk/subversion/svnversion/svnversion.c Thu Jul 11 16:19:04 2013
@@ -110,7 +110,7 @@ check_lib_versions(void)
     };
   SVN_VERSION_DEFINE(my_version);
 
-  return svn_ver_check_list(&my_version, checklist);
+  return svn_ver_check_list2(&my_version, checklist, svn_ver_equal);
 }
 
 /*



Mime
View raw message