static const char * SVNMasterVersion_cmd(cmd_parms *cmd, void *config, const char *arg1) { dir_conf_t *conf = config; svn_error_t *err; svn_version_t *version; err = svn_version__parse_version_string(&version, arg1, cmd->pool); if (err) { svn_error_clear(err); return "Malformed master server version string."; } conf->master_version = version; return NULL; }
svn_error_t * svn_fs__compatible_version(svn_version_t **compatible_version, apr_hash_t *config, apr_pool_t *pool) { svn_version_t *version; const char *compatible; /* set compatible version according to generic option. Make sure, we are always compatible to the current SVN version (or older). */ compatible = svn_hash_gets(config, SVN_FS_CONFIG_COMPATIBLE_VERSION); if (compatible) { SVN_ERR(svn_version__parse_version_string(&version, compatible, pool)); add_compatility(version, svn_subr_version()->major, svn_subr_version()->minor); } else { version = apr_pmemdup(pool, svn_subr_version(), sizeof(*version)); } /* specific options take precedence. Let the lowest version compatibility requirement win */ if (svn_hash_gets(config, SVN_FS_CONFIG_PRE_1_4_COMPATIBLE)) add_compatility(version, 1, 3); else if (svn_hash_gets(config, SVN_FS_CONFIG_PRE_1_5_COMPATIBLE)) add_compatility(version, 1, 4); else if (svn_hash_gets(config, SVN_FS_CONFIG_PRE_1_6_COMPATIBLE)) add_compatility(version, 1, 5); else if (svn_hash_gets(config, SVN_FS_CONFIG_PRE_1_8_COMPATIBLE)) add_compatility(version, 1, 7); /* we ignored the patch level and tag so far. * Give them a defined value. */ version->patch = 0; version->tag = ""; /* done here */ *compatible_version = version; return SVN_NO_ERROR; }