* 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 ### Minor changes
* Added specific clixon_suberrno code: XMLPARSE_ERRNO to identify XML parse errors. * Added specific clixon_suberrno code: XMLPARSE_ERRNO to identify XML parse errors.
* Removed all dependency on strverscmp
* Added libgen.h for baseline()
### Corrected Bugs ### Corrected Bugs
## 3.9.0 (21 Feb 2019) ## 3.9.0 (21 Feb 2019)

View file

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

View file

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

View file

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

2
configure vendored
View file

@ -4417,7 +4417,7 @@ _ACEOF
fi 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 : do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" 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(nsl, xdr_char)
AC_CHECK_LIB(dl, dlopen) 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 # CLIXON_DATADIR is where clixon installs the "system" yang files in yang/Makfile
# This directory should most probably be included in each application, # This directory should most probably be included in each application,

View file

@ -46,10 +46,14 @@ server {
} }
EOF 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 cat <<EOF > /usr/local/bin/test/site.sh
# Add your local site specific env variables (or tests) here. # 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= #IETFRFC=
EOF EOF

View file

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

View file

@ -37,12 +37,6 @@
#define strndup(s, n) clicon_strndup(s, n) #define strndup(s, n) clicon_strndup(s, n)
#endif #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 /* Set if you want to assert that all rpc messages have set username
*/ */
#undef RPC_USERNAME_ASSERT #undef RPC_USERNAME_ASSERT

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -11,7 +11,6 @@ new "Make DESTDIR install"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
err err
fi fi
new "Check installed files /usr" new "Check installed files /usr"
if [ ! -d $dir/usr ]; then if [ ! -d $dir/usr ]; then
err $dir/usr err $dir/usr
@ -59,3 +58,5 @@ l=$(find $dir -type l)
if [ -n "$l" ]; then if [ -n "$l" ]; then
err "$l" err "$l"
fi 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." 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; rm -f tmp_db candidate_db running_db startup_db) # remove databases
(cd $dir; cp non-compat-invalid.xml startup_db) (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." 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; rm -f tmp_db candidate_db running_db startup_db) # remove databases
(cd $dir; cp non-compat-invalid.xml running_db) (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." new "6. Load compatible invalid startup."
(cd $dir; rm -f tmp_db candidate_db running_db startup_db) # remove databases (cd $dir; rm -f tmp_db candidate_db running_db startup_db) # remove databases
(cd $dir; cp compat-invalid.xml startup_db) (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" 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 (cd $dir; rm -f tmp_db candidate_db running_db startup_db) # remove databases

View file

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