* Removed all dependency on strverscmp

* Added libgen.h for baseline()
This commit is contained in:
Olof Hagsand 2019-02-27 10:32:11 +01:00
parent d37aec7651
commit f035c3ca23
17 changed files with 20 additions and 33 deletions

View file

@ -25,7 +25,9 @@
### Minor changes
* Added specific clixon_suberrno code: XMLPARSE_ERRNO to identify XML parse errors.
* Removed all dependency on strverscmp
* Added libgen.h for baseline()
### Corrected Bugs
## 3.9.0 (21 Feb 2019)

View file

@ -39,7 +39,6 @@
#endif
#include <stdio.h>
#define __USE_GNU /* strverscmp */
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>

View file

@ -55,7 +55,7 @@
#include <sys/types.h>
#include <sys/ucred.h>
#endif
#define __USE_GNU
#define __USE_GNU /* for ucred */
#define _GNU_SOURCE /* for ucred */
#include <sys/socket.h>
#include <sys/param.h>

View file

@ -39,7 +39,6 @@
#endif
#include <stdio.h>
#define __USE_GNU /* strverscmp */
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>

2
configure vendored
View file

@ -4417,7 +4417,7 @@ _ACEOF
fi
for ac_func in inet_aton sigaction sigvec strlcpy strsep strndup alphasort versionsort strverscmp
for ac_func in inet_aton sigaction sigvec strlcpy strsep strndup alphasort versionsort
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

View file

@ -220,7 +220,7 @@ AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, xdr_char)
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_FUNCS(inet_aton sigaction sigvec strlcpy strsep strndup alphasort versionsort strverscmp)
AC_CHECK_FUNCS(inet_aton sigaction sigvec strlcpy strsep strndup alphasort versionsort)
# CLIXON_DATADIR is where clixon installs the "system" yang files in yang/Makfile
# This directory should most probably be included in each application,

View file

@ -46,10 +46,14 @@ server {
}
EOF
# This is a clixon site test file. Disable all model testing.
# This is a clixon site test file.
# Add to skiplist:
# - all 3rd party model testing (you need to download the repos)
# - test_install.sh since you dont have the make environment
# - test_order.sh XXX this is a bug need debugging
cat <<EOF > /usr/local/bin/test/site.sh
# Add your local site specific env variables (or tests) here.
SKIPLIST="test_yangmodels.sh test_openconfig.sh test_install.sh test_order.sh test_startup.sh test_upgrade.sh"
SKIPLIST="test_yangmodels.sh test_openconfig.sh test_install.sh test_order.sh"
#IETFRFC=
EOF

View file

@ -90,9 +90,6 @@
/* Define to 1 if you have the `strsep' function. */
#undef HAVE_STRSEP
/* Define to 1 if you have the `strverscmp' function. */
#undef HAVE_STRVERSCMP
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H

View file

@ -37,12 +37,6 @@
#define strndup(s, n) clicon_strndup(s, n)
#endif
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
#define BSD
/* at least for openbsd 4.5 i cannot get a hdr file */
int strverscmp (__const char *__s1, __const char *__s2);
#endif
/* Set if you want to assert that all rpc messages have set username
*/
#undef RPC_USERNAME_ASSERT

View file

@ -281,7 +281,7 @@ int yang_mandatory(yang_stmt *ys);
int yang_config(yang_stmt *ys);
int yang_spec_parse_module(clicon_handle h, const char *module,
const char *revision, yang_spec *yspec);
int yang_spec_parse_file(clicon_handle h, const char *filename, yang_spec *yspec);
int yang_spec_parse_file(clicon_handle h, char *filename, yang_spec *yspec);
int yang_spec_load_dir(clicon_handle h, char *dir, yang_spec *yspec);
cvec *yang_arg2cvec(yang_stmt *ys, char *delimi);
int yang_key_match(yang_node *yn, char *name);

View file

@ -39,7 +39,6 @@
#include <stdio.h>
#include <stdlib.h>
#define __USE_GNU /* strverscmp */
#include <string.h>
#include <errno.h>
#include <dirent.h>
@ -71,11 +70,7 @@ clicon_file_dirent_sort(const void* arg1,
struct dirent *d1 = (struct dirent *)arg1;
struct dirent *d2 = (struct dirent *)arg2;
#ifdef HAVE_STRVERSCMP
return strverscmp(d1->d_name, d2->d_name); /* strverscmp specific GNU function */
#else /* HAVE_STRVERSCMP */
return strcoll(d1->d_name, d2->d_name);
#endif /* HAVE_STRVERSCMP */
}
/*! Return alphabetically sorted files from a directory matching regexp

View file

@ -56,8 +56,6 @@
#include <limits.h>
#include <ctype.h>
#include <unistd.h>
#define __USE_GNU /* strverscmp */
#define _GNU_SOURCE
#include <string.h>
#include <arpa/inet.h>
#include <regex.h>
@ -66,6 +64,7 @@
#include <fcntl.h>
#include <syslog.h>
#include <assert.h>
#include <libgen.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <netinet/in.h>
@ -2449,7 +2448,7 @@ yang_spec_parse_module(clicon_handle h,
*/
int
yang_spec_parse_file(clicon_handle h,
const char *filename,
char *filename,
yang_spec *yspec)
{
int retval = -1;

View file

@ -44,7 +44,6 @@
#include <limits.h>
#include <ctype.h>
#include <unistd.h>
#define __USE_GNU /* strverscmp */
#include <string.h>
#include <arpa/inet.h>
#include <regex.h>

View file

@ -44,7 +44,6 @@
#include <inttypes.h>
#include <limits.h>
#include <ctype.h>
#define __USE_GNU /* strverscmp */
#include <string.h>
#include <arpa/inet.h>
#include <regex.h>

View file

@ -11,7 +11,6 @@ new "Make DESTDIR install"
if [ $? -ne 0 ]; then
err
fi
new "Check installed files /usr"
if [ ! -d $dir/usr ]; then
err $dir/usr
@ -59,3 +58,5 @@ l=$(find $dir -type l)
if [ -n "$l" ]; then
err "$l"
fi
rm -rf $dir

View file

@ -311,17 +311,17 @@ runtest startup '<data><a1 xmlns="urn:example:a">always work</a1><b xmlns="urn:e
new "4. Load non-compat invalid startup. Enter failsafe, startup invalid."
(cd $dir; rm -f tmp_db candidate_db running_db startup_db) # remove databases
(cd $dir; cp non-compat-invalid.xml startup_db)
runtest startup '<data><a1 xmlns="urn:example:a">always work</a1></data>' '<data><a1 xmlns="urn:example:a">always work</a1><b xmlns="urn:example:b">other text</b><a0 xmlns="urn:example:a">old version</a0><c xmlns="urn:example:c">bla bla</c></data>'
runtest startup '<data><a1 xmlns="urn:example:a">always work</a1></data>' '<data><a0 xmlns="urn:example:a">old version</a0><a1 xmlns="urn:example:a">always work</a1><b xmlns="urn:example:b">other text</b><c xmlns="urn:example:c">bla bla</c></data>'
new "5. Load non-compat invalid running. Enter failsafe, startup invalid."
(cd $dir; rm -f tmp_db candidate_db running_db startup_db) # remove databases
(cd $dir; cp non-compat-invalid.xml running_db)
runtest running '<data><a1 xmlns="urn:example:a">always work</a1></data>' '<data><a1 xmlns="urn:example:a">always work</a1><b xmlns="urn:example:b">other text</b><a0 xmlns="urn:example:a">old version</a0><c xmlns="urn:example:c">bla bla</c></data>'
runtest running '<data><a1 xmlns="urn:example:a">always work</a1></data>' '<data><a0 xmlns="urn:example:a">old version</a0><a1 xmlns="urn:example:a">always work</a1><b xmlns="urn:example:b">other text</b><c xmlns="urn:example:c">bla bla</c></data>'
new "6. Load compatible invalid startup."
(cd $dir; rm -f tmp_db candidate_db running_db startup_db) # remove databases
(cd $dir; cp compat-invalid.xml startup_db)
runtest startup '<data><a1 xmlns="urn:example:a">always work</a1></data>' '<data><a1 xmlns="urn:example:a">always work</a1><b xmlns="urn:example:b">other text</b><a0 xmlns="urn:example:a">old version</a0><c xmlns="urn:example:c">bla bla</c></data>'
runtest startup '<data><a1 xmlns="urn:example:a">always work</a1></data>' '<data><a0 xmlns="urn:example:a">old version</a0><a1 xmlns="urn:example:a">always work</a1><b xmlns="urn:example:b">other text</b><c xmlns="urn:example:c">bla bla</c></data>'
new "7. Load non-compat startup. Syntax fail, enter failsafe, startup invalid"
(cd $dir; rm -f tmp_db candidate_db running_db startup_db) # remove databases

View file

@ -45,7 +45,6 @@
#include <unistd.h>
#include <limits.h>
#include <ctype.h>
#define __USE_GNU /* strverscmp */
#include <string.h>
#include <arpa/inet.h>
#include <regex.h>