configure version major/minor derived from git

Remove compile-time COMPAT_6_5 and IDENTITYREF_KLUDGE
This commit is contained in:
Olof hagsand 2024-07-03 12:53:01 +02:00
parent 7aac03ba5e
commit 3e07a1d279
12 changed files with 23 additions and 119 deletions

View file

@ -1,5 +1,6 @@
# Clixon Changelog # Clixon Changelog
* [7.2.0](#720) Expected: October 2024
* [7.1.0](#710) 3 July 2024 * [7.1.0](#710) 3 July 2024
* [7.0.1](#701) 3 April 2024 * [7.0.1](#701) 3 April 2024
* [7.0.0](#700) 8 March 2024 * [7.0.0](#700) 8 March 2024
@ -10,10 +11,14 @@
* [6.1.0](#610) 19 Feb 2023 * [6.1.0](#610) 19 Feb 2023
* [6.0.0](#600) 29 Nov 2022 * [6.0.0](#600) 29 Nov 2022
## 7.2.0
Expected: October 2024
## 7.1.0 ## 7.1.0
3 July 2024 3 July 2024
The 7.1.0 release features RESTCONF notifications for native mode,
multi-datastore, and many new configure options.
### Features ### Features

View file

@ -291,8 +291,6 @@ yang2cli_var_identityref(yang_stmt *ys,
if (nodeid_split(cv_name_get(cv), &prefix, &id) < 0) if (nodeid_split(cv_name_get(cv), &prefix, &id) < 0)
goto done; goto done;
/* Translate from module-name(prefix) to global prefix /* Translate from module-name(prefix) to global prefix
* This is really a kludge for true identityref prefix handling
* IDENTITYREF_KLUDGE
* This is actually quite complicated: the cli needs to generate * This is actually quite complicated: the cli needs to generate
* a netconf statement with correct xmlns binding * a netconf statement with correct xmlns binding
*/ */

10
configure vendored
View file

@ -694,6 +694,7 @@ INSTALL_DATA
INSTALL_SCRIPT INSTALL_SCRIPT
INSTALL_PROGRAM INSTALL_PROGRAM
INCLUDES INCLUDES
CLIXON_VERSION_PATCH
CLIXON_VERSION_MINOR CLIXON_VERSION_MINOR
CLIXON_VERSION_MAJOR CLIXON_VERSION_MAJOR
CLIXON_VERSION CLIXON_VERSION
@ -2811,11 +2812,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# where autotool scripts are: install-sh, config.sub, config.guess # where autotool scripts are: install-sh, config.sub, config.guess
CLIXON_VERSION_MAJOR="7" # Use GIT version (what if no git?)
CLIXON_VERSION_MINOR="1"
CLIXON_VERSION_PATCH="0"
# Use GIT, if this does not work, need a fallback mechanism
CLIXON_VERSION="$(git log --pretty="format:%(describe) %ci" -n1)" CLIXON_VERSION="$(git log --pretty="format:%(describe) %ci" -n1)"
CLIXON_VERSION_MAJOR="$(echo $CLIXON_VERSION | awk -F "." '{print $1}')"
CLIXON_VERSION_MINOR="$(echo $CLIXON_VERSION | awk -F "." '{print $2}')"
CLIXON_VERSION_PATCH="$(echo $CLIXON_VERSION | awk -F "." '{print $3}' | awk -F " " '{print $1}')"
# Debug flag # Debug flag
# Check whether --enable-debug was given. # Check whether --enable-debug was given.
@ -4016,6 +4017,7 @@ test -n "$target_alias" &&
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: CLIXON version is ${CLIXON_VERSION}" >&5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: CLIXON version is ${CLIXON_VERSION}" >&5
printf "%s\n" "CLIXON version is ${CLIXON_VERSION}" >&6; } printf "%s\n" "CLIXON version is ${CLIXON_VERSION}" >&6; }

View file

@ -48,11 +48,11 @@ AC_CONFIG_SRCDIR([lib/clixon/clixon.h.in])
# where autotool scripts are: install-sh, config.sub, config.guess # where autotool scripts are: install-sh, config.sub, config.guess
AC_CONFIG_AUX_DIR(config-aux) AC_CONFIG_AUX_DIR(config-aux)
CLIXON_VERSION_MAJOR="7" # Use GIT version (what if no git?)
CLIXON_VERSION_MINOR="1"
CLIXON_VERSION_PATCH="0"
# Use GIT, if this does not work, need a fallback mechanism
CLIXON_VERSION="$(git log --pretty="format:%(describe) %ci" -n1)" CLIXON_VERSION="$(git log --pretty="format:%(describe) %ci" -n1)"
CLIXON_VERSION_MAJOR="$(echo $CLIXON_VERSION | awk -F "." '{print $1}')"
CLIXON_VERSION_MINOR="$(echo $CLIXON_VERSION | awk -F "." '{print $2}')"
CLIXON_VERSION_PATCH="$(echo $CLIXON_VERSION | awk -F "." '{print $3}' | awk -F " " '{print $1}')"
# Debug flag # Debug flag
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[Build with debug symbols, default: no]),[ AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[Build with debug symbols, default: no]),[
@ -88,6 +88,7 @@ AC_CANONICAL_TARGET
AC_SUBST(CLIXON_VERSION) AC_SUBST(CLIXON_VERSION)
AC_SUBST(CLIXON_VERSION_MAJOR) AC_SUBST(CLIXON_VERSION_MAJOR)
AC_SUBST(CLIXON_VERSION_MINOR) AC_SUBST(CLIXON_VERSION_MINOR)
AC_SUBST(CLIXON_VERSION_PATCH)
AC_MSG_RESULT(CLIXON version is ${CLIXON_VERSION}) AC_MSG_RESULT(CLIXON version is ${CLIXON_VERSION})

View file

@ -47,20 +47,6 @@
*/ */
#undef RPC_USERNAME_ASSERT #undef RPC_USERNAME_ASSERT
/*! Tag for wrong handling of identityref prefixes (XML encoding)
*
* See https://github.com/clicon/clixon/issues/90
* Instead of using generic xmlns prefix bindings, the module's own prefix
* is used.
* In the CLI generation case, this is actually quite complicated: the cli
* needs to generate a netconf statement with correct xmlns binding.
* The easy way to do this is to always generate all prefix/namespace bindings
* on the top-level for the modules involved in the netconf operation.
* Update 2022-11: seems most cornercases are covered and this is now disabled.
* I am sure there are remaining cases but undef this for now and close #90
*/
#undef IDENTITYREF_KLUDGE
/*! Optimize special list key searches in XPath finds /*! Optimize special list key searches in XPath finds
* *
* Identify xpaths that search for exactly a list key, eg: "y[k='3']" and then call * Identify xpaths that search for exactly a list key, eg: "y[k='3']" and then call
@ -198,14 +184,6 @@
*/ */
#undef RESTCONF_INLINE #undef RESTCONF_INLINE
/*! Backward compatible with 6.5 for Error, Log and Debug APIs
*
* Note: many(most) not covered by this constant need to GREP
* This includes lots of clicon->clixon namechanges, see CHANGELOG for whole list
* This constant will be removed after the 7.0 release
*/
#define COMPAT_6_5
/*! Use SHA256 (32 bytes) instead of SHA1 (20 bytes) /*! Use SHA256 (32 bytes) instead of SHA1 (20 bytes)
* *
* Digest use is not cryptographic use, so SHA1 is enough for now * Digest use is not cryptographic use, so SHA1 is enough for now

View file

@ -119,15 +119,4 @@ int clixon_err_exit(void);
/* doesnt work if arg != NULL */ /* doesnt work if arg != NULL */
#define clixon_netconf_error(h, x, f, a) clixon_err_fn((h), __FUNCTION__, __LINE__, OE_XML, 0,(x), (f)) #define clixon_netconf_error(h, x, f, a) clixon_err_fn((h), __FUNCTION__, __LINE__, OE_XML, 0,(x), (f))
#if 1 /* COMPAT_6_5 */
#define clicon_err(c,s,_fmt, args...) clixon_err_fn(NULL, __FUNCTION__, __LINE__, (c), (s), NULL, _fmt , ##args)
#define clicon_err_reset() clixon_err_reset()
#define clicon_errno clixon_err_category()
#define clicon_suberrno clixon_err_subnr()
#define clicon_err_reason clixon_err_reason()
#endif
#endif /* _CLIXON_ERR_H_ */ #endif /* _CLIXON_ERR_H_ */

View file

@ -92,11 +92,4 @@ struct event_stream;
int clicon_stream_set(clixon_handle h, struct event_stream *es); int clicon_stream_set(clixon_handle h, struct event_stream *es);
int clicon_stream_append(clixon_handle h, struct event_stream *es); int clicon_stream_append(clixon_handle h, struct event_stream *es);
/* COMPAT_6_5 */
#if 1
typedef void *clicon_handle;
#define clicon_handle_init() clixon_handle_init()
#define clicon_handle_exit(h) clixon_handle_exit(h)
#endif
#endif /* _CLIXON_HANDLE_H_ */ #endif /* _CLIXON_HANDLE_H_ */

View file

@ -83,19 +83,4 @@ int clixon_get_logflags(void);
int clixon_log_str(int level, char *msg); int clixon_log_str(int level, char *msg);
int clixon_log_fn(clixon_handle h, int user, int level, cxobj *x, const char *format, ...) __attribute__ ((format (printf, 5, 6))); int clixon_log_fn(clixon_handle h, int user, int level, cxobj *x, const char *format, ...) __attribute__ ((format (printf, 5, 6)));
#if 1 /* COMPAT_6_5 */
#define CLICON_LOG_SYSLOG CLIXON_LOG_SYSLOG
#define CLICON_LOG_STDERR CLIXON_LOG_STDERR
#define CLICON_LOG_STDOUT CLIXON_LOG_STDOUT
#define CLICON_LOG_FILE CLIXON_LOG_FILE
#define clicon_log(l, f, args...) clixon_log(NULL, (l), (f), ##args)
#define clicon_log_exit() clixon_log_exit()
#define clicon_log_opt(c) clixon_log_opt((c))
#define clicon_log_file(f) clixon_log_file((f))
int clicon_log_init(char *ident, int upto, int flags);
#endif /* COMPAT_6_5 */
#endif /* _CLIXON_LOG_H_ */ #endif /* _CLIXON_LOG_H_ */

View file

@ -238,20 +238,6 @@ check_body_namespace(cxobj *x0,
} }
#endif #endif
else{ /* Namespace does not exist in x0: error */ else{ /* Namespace does not exist in x0: error */
#ifdef IDENTITYREF_KLUDGE
int ret;
if (ns1 == NULL){
if ((ret = yang_find_namespace_by_prefix(y, prefix, &ns0)) < 0)
goto done;
if (ret == 0){ /* no such namespace in yang */
;
}
else{ /* Add it according to the kludge,... */
if (xml_add_attr(x0, prefix, ns0, "xmlns", NULL) == NULL)
goto done;
}
}
#else
if ((cberr = cbuf_new()) == NULL){ if ((cberr = cbuf_new()) == NULL){
clixon_err(OE_UNIX, errno, "cbuf_new"); clixon_err(OE_UNIX, errno, "cbuf_new");
goto done; goto done;
@ -260,7 +246,6 @@ check_body_namespace(cxobj *x0,
if (netconf_invalid_value(cbret, "application", cbuf_get(cberr)) < 0) if (netconf_invalid_value(cbret, "application", cbuf_get(cberr)) < 0)
goto done; goto done;
goto fail; goto fail;
#endif
} }
ok: ok:
retval = 1; retval = 1;

View file

@ -481,21 +481,6 @@ xml2json_encode_identityref(cxobj *xb,
if (xml2ns(xb, prefix, &namespace) < 0) if (xml2ns(xb, prefix, &namespace) < 0)
goto done; goto done;
/* We got the namespace, now get the module */ /* We got the namespace, now get the module */
// clixon_debug(CLIXON_DBG_DEFAULT, "body:%s prefix:%s namespace:%s", body, prefix, namespace);
#ifdef IDENTITYREF_KLUDGE
if (namespace == NULL){
/* If we dont find namespace here, we assume it is because of a missing
* xmlns that should be there, as a kludge we search for its (own)
* prefix in mymodule.
*/
if ((ymod = yang_find_module_by_prefix_yspec(yspec, prefix)) != NULL)
cprintf(cb, "%s:%s", yang_argument_get(ymod), id);
else
cprintf(cb, "%s", id);
}
else
#endif
{
if ((ymod = yang_find_module_by_namespace(yspec, namespace)) != NULL){ if ((ymod = yang_find_module_by_namespace(yspec, namespace)) != NULL){
if (ymod == my_ymod) if (ymod == my_ymod)
cprintf(cb, "%s", id); cprintf(cb, "%s", id);
@ -505,7 +490,6 @@ xml2json_encode_identityref(cxobj *xb,
} }
else else
cprintf(cb, "%s", id); cprintf(cb, "%s", id);
}
retval = 0; retval = 0;
done: done:
if (prefix) if (prefix)

View file

@ -161,19 +161,6 @@ clixon_log_init(clixon_handle h,
return 0; return 0;
} }
#ifdef COMPAT_6_5
/* Required for clixon-example autoconf
*/
int
clicon_log_init(char *ident,
int upto,
int flags)
{
return clixon_log_init(NULL, ident, upto, flags);
}
#endif
int int
clixon_log_exit(void) clixon_log_exit(void)
{ {

View file

@ -579,9 +579,6 @@ yang_find_module_by_prefix(yang_stmt *ys,
/*! Get module from its own prefix /*! Get module from its own prefix
* *
* This is really not a valid usecase, a kludge for the identityref derived
* list workaround (IDENTITYREF_KLUDGE)
* Actually, for canonical prefixes it is!
*/ */
yang_stmt * yang_stmt *
yang_find_module_by_prefix_yspec(yang_stmt *yspec, yang_find_module_by_prefix_yspec(yang_stmt *yspec,