diff -Nru ding-libs-0.5.0/aclocal.m4 ding-libs-0.6.0/aclocal.m4 --- ding-libs-0.5.0/aclocal.m4 2015-06-23 14:48:58.000000000 +0000 +++ ding-libs-0.6.0/aclocal.m4 2016-06-22 10:20:56.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.13.4 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -235,7 +235,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -247,10 +247,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.13' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.13.4], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -266,12 +266,12 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.13.4])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -291,7 +291,8 @@ : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], - [am_cv_ar_interface=ar + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) @@ -308,7 +309,7 @@ fi rm -f conftest.lib libconftest.a ]) - ]) + AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) @@ -332,7 +333,7 @@ # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -377,15 +378,14 @@ # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -416,7 +416,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -607,7 +607,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -683,7 +683,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -692,6 +692,12 @@ # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -767,8 +773,8 @@ # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -800,6 +806,51 @@ AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -808,7 +859,6 @@ m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -830,7 +880,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -841,7 +891,7 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -851,7 +901,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -872,7 +922,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -920,41 +970,9 @@ rm -f confinc confmf ]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_CC_C_O -# -------------- -# Like AC_PROG_CC_C_O, but changed for automake. -AC_DEFUN([AM_PROG_CC_C_O], -[AC_REQUIRE([AC_PROG_CC_C_O])dnl -AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -dnl Make sure AC_PROG_CC is never called again, or it will override our -dnl setting of CC. -m4_define([AC_PROG_CC], - [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) -]) - # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -993,7 +1011,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1022,9 +1040,73 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1105,7 +1187,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1165,7 +1247,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1193,7 +1275,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1212,7 +1294,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -Nru ding-libs-0.5.0/build/ar-lib ding-libs-0.6.0/build/ar-lib --- ding-libs-0.5.0/build/ar-lib 2015-06-23 14:49:00.000000000 +0000 +++ ding-libs-0.6.0/build/ar-lib 2016-06-22 10:20:57.000000000 +0000 @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2012-03-01.08; # UTC -# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Copyright (C) 2010-2014 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify diff -Nru ding-libs-0.5.0/build/compile ding-libs-0.6.0/build/compile --- ding-libs-0.5.0/build/compile 2015-06-23 14:49:00.000000000 +0000 +++ ding-libs-0.6.0/build/compile 2016-06-22 10:20:57.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify diff -Nru ding-libs-0.5.0/build/config.guess ding-libs-0.6.0/build/config.guess --- ding-libs-0.5.0/build/config.guess 2015-06-23 14:49:00.000000000 +0000 +++ ding-libs-0.6.0/build/config.guess 2016-06-22 10:20:57.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-03-23' +timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -579,8 +579,9 @@ else IBM_ARCH=powerpc fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if [ -x /usr/bin/lslpp ] ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi diff -Nru ding-libs-0.5.0/build/config.sub ding-libs-0.6.0/build/config.sub --- ding-libs-0.5.0/build/config.sub 2015-06-23 14:49:00.000000000 +0000 +++ ding-libs-0.6.0/build/config.sub 2016-06-22 10:20:57.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2014-07-28' +timestamp='2015-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -68,7 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -260,7 +260,7 @@ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ - | fido | fr30 | frv \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ @@ -302,6 +302,7 @@ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -312,6 +313,7 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -326,6 +328,9 @@ c6x) basic_machine=tic6x-unknown ;; + leon|leon[3-9]) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -436,6 +441,7 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -773,6 +779,9 @@ basic_machine=m68k-isi os=-sysv ;; + leon-*|leon[3-9]-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux diff -Nru ding-libs-0.5.0/build/depcomp ding-libs-0.6.0/build/depcomp --- ding-libs-0.5.0/build/depcomp 2015-06-23 14:49:00.000000000 +0000 +++ ding-libs-0.6.0/build/depcomp 2016-06-22 10:20:57.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru ding-libs-0.5.0/build/install-sh ding-libs-0.6.0/build/install-sh --- ding-libs-0.5.0/build/install-sh 2015-06-23 14:49:00.000000000 +0000 +++ ding-libs-0.6.0/build/install-sh 2016-06-22 10:20:57.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,46 +122,57 @@ -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -208,6 +204,15 @@ fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -223,16 +228,16 @@ *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -269,41 +274,15 @@ # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi @@ -314,74 +293,74 @@ if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -391,53 +370,51 @@ # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue + test X"$d" = X && continue - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -472,15 +449,12 @@ # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -493,24 +467,24 @@ # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 diff -Nru ding-libs-0.5.0/build/missing ding-libs-0.6.0/build/missing --- ding-libs-0.5.0/build/missing 2015-06-23 14:49:00.000000000 +0000 +++ ding-libs-0.6.0/build/missing 2016-06-22 10:20:57.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-06-26.16; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ ;; autom4te*) echo "You might have modified some maintainer files that require" - echo "the 'automa4te' program to be rebuilt." + echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) diff -Nru ding-libs-0.5.0/build/test-driver ding-libs-0.6.0/build/test-driver --- ding-libs-0.5.0/build/test-driver 2015-06-23 14:49:00.000000000 +0000 +++ ding-libs-0.6.0/build/test-driver 2016-06-22 10:20:58.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2012-06-27.10; # UTC +scriptversion=2013-07-13.22; # UTC -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2014 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -44,13 +44,12 @@ Usage: test-driver --test-name=NAME --log-file=PATH --trs-file=PATH [--expect-failure={yes|no}] [--color-tests={yes|no}] - [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT + [--enable-hard-errors={yes|no}] [--] + TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] The '--test-name', '--log-file' and '--trs-file' options are mandatory. END } -# TODO: better error handling in option parsing (in particular, ensure -# TODO: $log_file, $trs_file and $test_name are defined). test_name= # Used for reporting. log_file= # Where to save the output of the test script. trs_file= # Where to save the metadata of the test run. @@ -69,10 +68,23 @@ --enable-hard-errors) enable_hard_errors=$2; shift;; --) shift; break;; -*) usage_error "invalid option: '$1'";; + *) break;; esac shift done +missing_opts= +test x"$test_name" = x && missing_opts="$missing_opts --test-name" +test x"$log_file" = x && missing_opts="$missing_opts --log-file" +test x"$trs_file" = x && missing_opts="$missing_opts --trs-file" +if test x"$missing_opts" != x; then + usage_error "the following mandatory options are missing:$missing_opts" +fi + +if test $# -eq 0; then + usage_error "missing argument" +fi + if test $color_tests = yes; then # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. red='' # Red. @@ -94,11 +106,14 @@ # Test script is run here. "$@" >$log_file 2>&1 estatus=$? + if test $enable_hard_errors = no && test $estatus -eq 99; then - estatus=1 + tweaked_estatus=1 +else + tweaked_estatus=$estatus fi -case $estatus:$expect_failure in +case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; @@ -107,6 +122,12 @@ *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + # Report outcome to console. echo "${col}${res}${std}: $test_name" diff -Nru ding-libs-0.5.0/config.h.in ding-libs-0.6.0/config.h.in --- ding-libs-0.5.0/config.h.in 2015-06-23 14:48:59.000000000 +0000 +++ ding-libs-0.6.0/config.h.in 2016-06-22 10:20:57.000000000 +0000 @@ -46,9 +46,6 @@ /* Max length of the key in the INI file. */ #undef MAX_KEY -/* Define to 1 if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O - /* Name of package */ #undef PACKAGE diff -Nru ding-libs-0.5.0/configure ding-libs-0.6.0/configure --- ding-libs-0.5.0/configure 2015-06-23 14:48:59.000000000 +0000 +++ ding-libs-0.6.0/configure 2016-06-22 10:20:57.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ding-libs 0.5.0. +# Generated by GNU Autoconf 2.69 for ding-libs 0.6.0. # # Report bugs to . # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='ding-libs' PACKAGE_TARNAME='ding-libs' -PACKAGE_VERSION='0.5.0' -PACKAGE_STRING='ding-libs 0.5.0' +PACKAGE_VERSION='0.6.0' +PACKAGE_STRING='ding-libs 0.6.0' PACKAGE_BUGREPORT='sssd-devel@lists.fedorahosted.org' PACKAGE_URL='' @@ -1338,7 +1338,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ding-libs 0.5.0 to adapt to many kinds of systems. +\`configure' configures ding-libs 0.6.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1408,7 +1408,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ding-libs 0.5.0:";; + short | recursive ) echo "Configuration of ding-libs 0.6.0:";; esac cat <<\_ACEOF @@ -1522,7 +1522,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ding-libs configure 0.5.0 +ding-libs configure 0.6.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2074,7 +2074,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ding-libs $as_me 0.5.0, which was +It was created by ding-libs $as_me 0.6.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2452,6 +2452,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3241,6 +3244,65 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3701,7 +3763,7 @@ -am__api_version='1.13' +am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -3873,9 +3935,6 @@ ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) @@ -3893,7 +3952,7 @@ $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -4250,7 +4309,7 @@ # Define the identity of the package. PACKAGE='ding-libs' - VERSION='0.5.0' + VERSION='0.6.0' cat >>confdefs.h <<_ACEOF @@ -4284,8 +4343,8 @@ # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -4429,129 +4488,46 @@ -if test "x$CC" != xcc; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 -$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 -$as_echo_n "checking whether cc understands -c and -o together... " >&6; } -fi -set dummy $CC; ac_cc=`$as_echo "$2" | - sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. -int -main () -{ +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. - ; - return 0; -} -_ACEOF -# Make sure it works both with $CC and with simple cc. -# We do the test twice because some compilers refuse to overwrite an -# existing .o file with -o, though they will create one. -ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -rm -f conftest2.* -if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; -then - eval ac_cv_prog_cc_${ac_cc}_c_o=yes - if test "x$CC" != xcc; then - # Test first that cc exists at all. - if { ac_try='cc -c conftest.$ac_ext >&5' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' - rm -f conftest2.* - if { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && - test -f conftest2.$ac_objext && { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; - then - # cc works too. - : - else - # cc exists but doesn't like -o. - eval ac_cv_prog_cc_${ac_cc}_c_o=no - fi - fi +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi -else - eval ac_cv_prog_cc_${ac_cc}_c_o=no -fi -rm -f core conftest* - -fi -if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h - -fi - -# FIXME: we rely on the cache variable name because -# there is no other way. -set dummy $CC -am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o -if test "$am_t" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" fi @@ -4662,7 +4638,13 @@ if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_ar_interface=ar + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; @@ -4693,6 +4675,11 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 @@ -12180,7 +12167,7 @@ BASICOBJECTS_VERSION=0.1.1 -INI_CONFIG_VERSION=1.2.0 +INI_CONFIG_VERSION=1.3.0 if git log -1 &>/dev/null; then @@ -12905,7 +12892,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ding-libs $as_me 0.5.0, which was +This file was extended by ding-libs $as_me 0.6.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12971,7 +12958,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ding-libs config.status 0.5.0 +ding-libs config.status 0.6.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru ding-libs-0.5.0/contrib/ding-libs.spec.in ding-libs-0.6.0/contrib/ding-libs.spec.in --- ding-libs-0.5.0/contrib/ding-libs.spec.in 2015-06-23 12:12:00.000000000 +0000 +++ ding-libs-0.6.0/contrib/ding-libs.spec.in 2016-06-22 10:03:58.000000000 +0000 @@ -51,6 +51,7 @@ Requires: libdhash-devel = %{dhash_version}-%{release} Requires: libcollection-devel = %{collection_version}-%{release} Requires: libref_array-devel = %{ref_array_version}-%{release} +Requires: libbasicobjects-devel = %{basicobjects_version}-%{release} Requires: libini_config-devel = %{ini_config_version}-%{release} %description devel @@ -303,7 +304,7 @@ %doc COPYING %doc COPYING.LESSER %{_libdir}/libini_config.so.5 -%{_libdir}/libini_config.so.5.1.0 +%{_libdir}/libini_config.so.5.2.0 %files -n libini_config-devel %defattr(-,root,root,-) diff -Nru ding-libs-0.5.0/debian/changelog ding-libs-0.6.0/debian/changelog --- ding-libs-0.5.0/debian/changelog 2016-11-02 06:51:34.000000000 +0000 +++ ding-libs-0.6.0/debian/changelog 2016-11-02 06:51:34.000000000 +0000 @@ -1,3 +1,14 @@ +ding-libs (0.6.0-1) unstable; urgency=medium + + * New upstream release. + * libini-config5.symbols: Updated. + * rules: pass -c4 to dpkg-gensymbols. + * copyright: Updated a bit. + * control: Bump policy to 3.9.8, no changes. + * control: Update vcs urls to use https/anonscm/cgit. + + -- Timo Aaltonen Mon, 19 Sep 2016 15:01:06 +0300 + ding-libs (0.5.0-1) unstable; urgency=medium * New upstream release. diff -Nru ding-libs-0.5.0/debian/control ding-libs-0.6.0/debian/control --- ding-libs-0.5.0/debian/control 2016-11-02 06:51:34.000000000 +0000 +++ ding-libs-0.6.0/debian/control 2016-11-02 06:51:34.000000000 +0000 @@ -8,10 +8,10 @@ quilt, check, pkg-config, -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Homepage: https://fedorahosted.org/sssd/ -Vcs-Git: git://git.debian.org/pkg-sssd/ding-libs.git -Vcs-Browser: http://git.debian.org/?p=pkg-sssd/ding-libs.git;a=summary +Vcs-Git: https://anonscm.debian.org/git/pkg-sssd/ding-libs.git +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-sssd/ding-libs.git Package: libpath-utils-dev Section: libdevel diff -Nru ding-libs-0.5.0/debian/copyright ding-libs-0.6.0/debian/copyright --- ding-libs-0.5.0/debian/copyright 2016-11-02 06:51:34.000000000 +0000 +++ ding-libs-0.6.0/debian/copyright 2016-11-02 06:51:34.000000000 +0000 @@ -2,18 +2,14 @@ Upstream-Name: ding-libs Source: https://fedorahosted.org/sssd/wiki/Releases#DING-LIBSReleases +Files: * +Copyright: 2009-2016 Dmitri Pal +License: LGPL-3+ + Files: basicobjects/simplebuffer* Copyright: 2009-2010 Dmitri Pal License: GPL-3+ -Files: collection/* -Copyright: 2009 Dmitri Pal -License: LGPL-3+ - -Files: ini/* -Copyright: 2009-2012 Dmitri Pal -License: LGPL-3+ - Files: build/ltmain.sh Copyright: 1996 Gordon Matzigkeit License: GPL-2+ @@ -30,10 +26,6 @@ Copyright: 2009 Dmitri Pal License: GPL-3+ -Files: trace/* -Copyright: 2009 Dmitri Pal -License: LGPL-3+ - Files: debian/* Copyright: 2011 Fabrice Coutadeur , 2011 Jonathan Carter , diff -Nru ding-libs-0.5.0/debian/libini-config5.symbols ding-libs-0.6.0/debian/libini-config5.symbols --- ding-libs-0.5.0/debian/libini-config5.symbols 2016-11-02 06:51:34.000000000 +0000 +++ ding-libs-0.6.0/debian/libini-config5.symbols 2016-11-02 06:51:34.000000000 +0000 @@ -1,6 +1,7 @@ libini_config.so.5 libini-config5 #MINVER# INI_CONFIG_1.1.0@INI_CONFIG_1.1.0 0.4.0 INI_CONFIG_1.2.0@INI_CONFIG_1.2.0 0.5.0 + INI_CONFIG_1.3.0@INI_CONFIG_1.3.0 0.6.0 config_access_check@INI_CONFIG_1.1.0 0.4.0 config_changed@INI_CONFIG_1.1.0 0.4.0 config_for_app@INI_CONFIG_1.1.0 0.4.0 @@ -108,6 +109,14 @@ ini_config_set_bom@INI_CONFIG_1.2.0 0.5.0 ini_config_set_wrap@INI_CONFIG_1.1.0 0.4.0 ini_config_update_comment@INI_CONFIG_1.2.0 0.5.0 + ini_errobj_add_msg@INI_CONFIG_1.3.0 0.6.0 + ini_errobj_count@INI_CONFIG_1.3.0 0.6.0 + ini_errobj_create@INI_CONFIG_1.3.0 0.6.0 + ini_errobj_destroy@INI_CONFIG_1.3.0 0.6.0 + ini_errobj_get_msg@INI_CONFIG_1.3.0 0.6.0 + ini_errobj_next@INI_CONFIG_1.3.0 0.6.0 + ini_errobj_no_more_msgs@INI_CONFIG_1.3.0 0.6.0 + ini_errobj_reset@INI_CONFIG_1.3.0 0.6.0 ini_free_attribute_list@INI_CONFIG_1.1.0 0.4.0 ini_free_bin_config_value@INI_CONFIG_1.1.0 0.4.0 ini_free_double_config_array@INI_CONFIG_1.1.0 0.4.0 @@ -134,6 +143,9 @@ ini_get_uint64_config_value@INI_CONFIG_1.1.0 0.4.0 ini_get_ulong_config_value@INI_CONFIG_1.1.0 0.4.0 ini_get_unsigned_config_value@INI_CONFIG_1.1.0 0.4.0 + ini_rules_check@INI_CONFIG_1.3.0 0.6.0 + ini_rules_destroy@INI_CONFIG_1.3.0 0.6.0 + ini_rules_read_from_file@INI_CONFIG_1.3.0 0.6.0 print_config_parsing_errors@INI_CONFIG_1.1.0 0.4.0 print_file_parsing_errors@INI_CONFIG_1.1.0 0.4.0 value_add_to_arrays@INI_CONFIG_1.1.0 0.4.0 diff -Nru ding-libs-0.5.0/debian/rules ding-libs-0.6.0/debian/rules --- ding-libs-0.5.0/debian/rules 2016-11-02 06:51:34.000000000 +0000 +++ ding-libs-0.6.0/debian/rules 2016-11-02 06:51:34.000000000 +0000 @@ -12,3 +12,6 @@ find $(CURDIR)/debian/tmp/ -name '*.la' -exec rm '{}' ';' dh_install --fail-missing + +override_dh_makeshlibs: + dh_makeshlibs -a -- -c4 diff -Nru ding-libs-0.5.0/ini/ini_augment_ut.c ding-libs-0.6.0/ini/ini_augment_ut.c --- ding-libs-0.5.0/ini/ini_augment_ut.c 2015-06-23 12:12:00.000000000 +0000 +++ ding-libs-0.6.0/ini/ini_augment_ut.c 2016-06-22 10:03:58.000000000 +0000 @@ -214,9 +214,8 @@ "^real\\.conf$", NULL }; - /* Match all that do not start with 'r' - * and end with '.conf' and then match all - * ending with '.conf' */ + /* Match only the config, monitor, domains, services, and provider + * sections */ const char *sections[] = { "config", "monitor", "domains", diff -Nru ding-libs-0.5.0/ini/ini_configobj.c ding-libs-0.6.0/ini/ini_configobj.c --- ding-libs-0.5.0/ini/ini_configobj.c 2015-06-23 12:12:00.000000000 +0000 +++ ding-libs-0.6.0/ini/ini_configobj.c 2016-06-22 10:03:58.000000000 +0000 @@ -20,11 +20,14 @@ */ #include "config.h" +#include +#include #include #include #include #include #include +#include /* For error text */ #include #define _(String) gettext (String) @@ -1039,3 +1042,737 @@ TRACE_FLOW_EXIT(); return error; } + +int ini_rules_read_from_file(const char *filename, + struct ini_cfgobj **_rules_obj) +{ + int ret; + struct ini_cfgfile *cfgfile = NULL; + + if (_rules_obj == NULL) { + return EINVAL; + } + + ret = ini_config_create(_rules_obj); + if (ret != EOK) { + return ret; + } + + ret = ini_config_file_open(filename, 0, &cfgfile); + if (ret != EOK) { + goto done; + } + + ret = ini_config_parse(cfgfile, 0, INI_MV1S_ALLOW, 0, *_rules_obj); + if (ret != EOK) { + goto done; + } + +done: + if (ret != EOK) { + ini_config_destroy(*_rules_obj); + *_rules_obj = NULL; + } + + ini_config_file_destroy(cfgfile); + return ret; +} + +/* This is used for testing only */ +static int ini_dummy_noerror(const char *rule_name, + struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_errobj *errobj, + void **data) +{ + return 0; +} + +/* This is used for testing only */ +static int ini_dummy_error(const char *rule_name, + struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_errobj *errobj, + void **data) +{ + return ini_errobj_add_msg(errobj, "Error"); +} + +static int is_allowed_section(const char *tested_section, + char **allowed_sections, + size_t num_sec, + regex_t *allowed_sections_re, + size_t num_sec_re, + int case_insensitive) +{ + int ret; + int i; + + if (case_insensitive) { + for (i = 0; i < num_sec; i++) { + if (strcasecmp(tested_section, allowed_sections[i]) == 0) { + return 1; + } + } + } else { /* case sensitive */ + for (i = 0; i < num_sec; i++) { + if (strcmp(tested_section, allowed_sections[i]) == 0) { + return 1; + } + } + } + + for (i = 0; i < num_sec_re; i++) { + ret = regexec(&allowed_sections_re[i], tested_section, 0, NULL, 0); + if (ret == 0) { + return 1; + } + } + + return 0; +} + +static int ini_allowed_sections(const char *rule_name, + struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_errobj *errobj, + void **data) +{ + struct value_obj *vo = NULL; + int ret; + char *regex_str = NULL; + char **allowed_sections = NULL; + char *insensitive_str; + char **cfg_sections = NULL; + int num_cfg_sections; + char **attributes = NULL; + int num_attributes; + size_t num_sec = 0; + size_t num_sec_re = 0; + regex_t *allowed_sections_re = NULL; + size_t buf_size; + int reg_err; + int is_allowed; + int case_insensitive = 0; + int regcomp_flags = REG_NOSUB; + int i; + + /* Get number of 'section' and 'section_re' attributes + * in this rule */ + attributes = ini_get_attribute_list(rules_obj, + rule_name, + &num_attributes, + NULL); + if (attributes == NULL) { + ret = ENOMEM; + goto done; + } + + for (i = 0; i < num_attributes; i++) { + if (strcmp("section", attributes[i]) == 0) { + num_sec++; + } + + if (strcmp("section_re", attributes[i]) == 0) { + num_sec_re++; + } + } + + ini_free_attribute_list(attributes); + + if (num_sec == 0 && num_sec_re == 0) { + /* This rule is empty. */ + ret = ini_errobj_add_msg(errobj, + "No allowed sections specified. " + "Use 'section = default' to allow only " + "default section"); + goto done; + } + + ret = ini_get_config_valueobj(rule_name, + "case_insensitive", + rules_obj, + INI_GET_NEXT_VALUE, + &vo); + if (ret) { + goto done; + } + + if (vo) { + insensitive_str = ini_get_string_config_value(vo, &ret); + if (ret) { + goto done; + } + + if (strcasecmp(insensitive_str, "yes") == 0 + || strcasecmp(insensitive_str, "true") == 0 + || strcmp(insensitive_str, "1") == 0) { + case_insensitive = 1; + regcomp_flags |= REG_ICASE; + } + + free(insensitive_str); + } + + /* Create arrays for section_re regexes and section name + * strings. */ + allowed_sections = calloc(num_sec + 1, sizeof(char *)); + if (allowed_sections == NULL) { + ret = ENOMEM; + goto done; + } + + allowed_sections_re = calloc(num_sec_re + 1, sizeof(regex_t)); + if (allowed_sections_re == NULL) { + ret = ENOMEM; + goto done; + } + + /* Get all allowed section names and store them to + * allowed_sections array */ + for (i = 0; i < num_sec; i++) { + ret = ini_get_config_valueobj(rule_name, + "section", + rules_obj, + INI_GET_NEXT_VALUE, + &vo); + if (ret) { + goto done; + } + + allowed_sections[i] = ini_get_string_config_value(vo, &ret); + if (ret) { + goto done; + } + } + + /* Get all regular section_re regular expresions and + * store them to allowed_sections_re array */ + for (i = 0; i < num_sec_re; i++) { + ret = ini_get_config_valueobj(rule_name, + "section_re", + rules_obj, + INI_GET_NEXT_VALUE, + &vo); + if (ret) { + goto done; + } + + regex_str = ini_get_string_config_value(vo, &ret); + if (ret) { + goto done; + } + + reg_err = regcomp(&allowed_sections_re[i], regex_str, regcomp_flags); + if (reg_err) { + char *err_str; + + buf_size = regerror(reg_err, &allowed_sections_re[i], NULL, 0); + err_str = malloc(buf_size); + if (err_str == NULL) { + ret = ENOMEM; + goto done; + } + + regerror(reg_err, &allowed_sections_re[i], err_str, buf_size); + ret = ini_errobj_add_msg(errobj, + "Validator failed to use regex [%s]:[%s]", + regex_str, err_str); + free(err_str); + ret = ret ? ret : EINVAL; + goto done; + } + free(regex_str); + regex_str = NULL; + } + + /* Finally get list of all sections in configuration and + * check if they are matched by some string in allowed_sections + * or regex in allowed_sections_re */ + cfg_sections = ini_get_section_list(config_obj, &num_cfg_sections, &ret); + if (ret != EOK) { + goto done; + } + + for (i = 0; i < num_cfg_sections; i++) { + is_allowed = is_allowed_section(cfg_sections[i], + allowed_sections, + num_sec, + allowed_sections_re, + num_sec_re, + case_insensitive); + if (!is_allowed) { + ret = ini_errobj_add_msg(errobj, + "Section [%s] is not allowed. " + "Check for typos.", + cfg_sections[i]); + if (ret) { + goto done; + } + } + } + + ret = EOK; +done: + if (allowed_sections != NULL) { + for (i = 0; allowed_sections[i] != NULL; i++) { + free(allowed_sections[i]); + } + free(allowed_sections); + } + if (allowed_sections_re != NULL) { + for (i = 0; i < num_sec_re; i++) { + regfree(&allowed_sections_re[i]); + } + free(allowed_sections_re); + } + ini_free_section_list(cfg_sections); + free(regex_str); + + return ret; +} + +static int check_if_allowed(char *section, char *attr, char **allowed, + int num_allowed, struct ini_errobj *errobj) +{ + int is_allowed = 0; + int ret; + int i; + + for (i = 0; i < num_allowed; i++) { + if (strcmp(attr, allowed[i]) == 0) { + is_allowed = 1; + break; + } + } + + if (!is_allowed) { + ret = ini_errobj_add_msg(errobj, + "Attribute '%s' is not allowed in " + "section '%s'. Check for typos.", + attr, section); + return ret; + } + + return 0; +} + +static int ini_allowed_options(const char *rule_name, + struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_errobj *errobj, + void **data) +{ + struct value_obj *vo = NULL; + int ret; + char *section_regex; + int num_sections; + char **sections = NULL; + char **attributes = NULL; + int num_attributes; + int num_opts = 0; + int i; + int a; + regex_t preg; + size_t buf_size; + char *err_str = NULL; + int reg_err; + char **allowed = NULL; + + /* Get section regex */ + ret = ini_get_config_valueobj(rule_name, + "section_re", + rules_obj, + INI_GET_FIRST_VALUE, + &vo); + if (ret != 0) { + return ret; + } + + if (vo == NULL) { + ret = ini_errobj_add_msg(errobj, + "Validator misses 'section_re' parameter"); + if (ret) { + return ret; + } + return EINVAL; + } + + section_regex = ini_get_string_config_value(vo, NULL); + if (section_regex == NULL || section_regex[0] == '\0') { + ret = ini_errobj_add_msg(errobj, + "Validator misses 'section_re' parameter"); + if (ret) { + return ret; + } + + free(section_regex); + return EINVAL; + } + + /* compile the regular expression */ + reg_err = regcomp(&preg, section_regex, REG_NOSUB); + if (reg_err) { + buf_size = regerror(reg_err, &preg, NULL, 0); + err_str = malloc(buf_size); + if (err_str == NULL) { + ret = ENOMEM; + goto done; + } + + regerror(reg_err, &preg, err_str, buf_size); + ret = ini_errobj_add_msg(errobj, + "Cannot compile regular expression from " + "option 'section_re'. Error: '%s'", err_str); + ret = ret ? ret : EINVAL; + goto done; + } + + /* Get all sections from config_obj */ + sections = ini_get_section_list(config_obj, &num_sections, &ret); + if (ret != EOK) { + goto done; + } + + /* Get number of 'option' attributes in this rule + * and create an array long enough to store them all */ + attributes = ini_get_attribute_list(rules_obj, + rule_name, + &num_attributes, + NULL); + if (attributes == NULL) { + ret = ENOMEM; + goto done; + } + + for (i = 0; i < num_attributes; i++) { + if (strcmp("option", attributes[i]) == 0) { + num_opts++; + } + } + + ini_free_attribute_list(attributes); + attributes = NULL; + + allowed = calloc(num_opts + 1, sizeof(char *)); + if (allowed == NULL) { + ret = ENOMEM; + goto done; + } + + for (i = 0; i < num_opts; i++) { + ret = ini_get_config_valueobj(rule_name, + "option", + rules_obj, + INI_GET_NEXT_VALUE, + &vo); + if (ret) { + goto done; + } + + allowed[i] = ini_get_string_config_value(vo, &ret); + if (ret) { + goto done; + } + } + + for (i = 0; i < num_sections; i++) { + if (regexec(&preg, sections[i], 0, NULL, 0) == 0) { + /* Regex matched section */ + /* Get options from this section */ + attributes = ini_get_attribute_list(config_obj, + sections[i], + &num_attributes, + NULL); + if (attributes == NULL) { + ret = ENOMEM; + goto done; + } + + for (a = 0; a < num_attributes; a++) { + ret = check_if_allowed(sections[i], attributes[a], allowed, + num_opts, errobj); + if (ret != 0) { + goto done; + } + } + ini_free_attribute_list(attributes); + attributes = NULL; + } + } + + ret = 0; +done: + if (allowed != NULL) { + for (i = 0; allowed[i] != NULL; i++) { + free(allowed[i]); + } + free(allowed); + } + ini_free_section_list(sections); + free(section_regex); + ini_free_attribute_list(attributes); + regfree(&preg); + free(err_str); + return ret; +} + +static ini_validator_func * +get_validator(char *validator_name, + struct ini_validator **validators) +{ + struct ini_validator *ext_validator; + + /* First we check all internal validators */ + if (strcmp(validator_name, "ini_dummy_noerror") == 0) { + return ini_dummy_noerror; + } else if (strcmp(validator_name, "ini_dummy_error") == 0) { + return ini_dummy_error; + } else if (strcmp(validator_name, "ini_allowed_options") == 0) { + return ini_allowed_options; + } else if (strcmp(validator_name, "ini_allowed_sections") == 0) { + return ini_allowed_sections; + } + + if (validators == NULL) { + return NULL; + } + + for (; *validators != NULL; ++validators) { + ext_validator = *validators; + + /* Skip invalid external validator. Name is required */ + if (ext_validator->name == NULL) { + continue; + } + if (strcmp(validator_name, ext_validator->name) == 0) { + return ext_validator->func; + } + } + + return NULL; +} + +int ini_rules_check(struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_validator **extra_validators, + struct ini_errobj *errobj) +{ + char **sections; + int ret; + int num_sections; + char *vname; + ini_validator_func *vfunc; + struct value_obj *vo = NULL; + struct ini_errobj *localerr = NULL; + int i; + + /* Get all sections from the rules object */ + sections = ini_get_section_list(rules_obj, &num_sections, &ret); + if (ret != EOK) { + return ret; + } + + /* Now iterate through all the sections. If the section + * name begins with a prefix "rule/", then it is a rule + * name. */ + for (i = 0; i < num_sections; i++) { + if (!strncmp(sections[i], "rule/", sizeof("rule/") - 1)) { + ret = ini_get_config_valueobj(sections[i], + "validator", + rules_obj, + INI_GET_FIRST_VALUE, + &vo); + if (ret != 0) { + /* Failed to get value object. This should not + * happen. */ + continue; + } + + if (vo == NULL) { + ret = ini_errobj_add_msg(errobj, + "Rule '%s' has no validator.", + sections[i]); + if (ret != EOK) { + return ret; + } + /* Skip problematic rule */ + continue; + } + + vname = ini_get_string_config_value(vo, NULL); + vfunc = get_validator(vname, extra_validators); + if (vfunc == NULL) { + ret = ini_errobj_add_msg(errobj, + "Rule '%s' uses unknown " + "validator '%s'.", + sections[i], vname); + if (ret != EOK) { + goto done; + } + /* Skip problematic rule */ + free(vname); + continue; + } + free(vname); + + /* Do not pass global errobj to validators, they + * could corrupt it. Create local one for each + * validator. */ + ret = ini_errobj_create(&localerr); + if (ret != EOK) { + goto done; + } + + ret = vfunc(sections[i], rules_obj, config_obj, localerr, NULL); + if (ret != 0) { + /* Just report the error and continue normally, + * maybe there are some errors in localerr */ + ret = ini_errobj_add_msg(errobj, + "Rule '%s' returned error code '%d'", + sections[i], ret); + if (ret != EOK) { + goto done; + } + } + + /* Bad validator could destroy the localerr, check + * for NULL */ + if (localerr == NULL) { + continue; + } + + ini_errobj_reset(localerr); + while (!ini_errobj_no_more_msgs(localerr)) { + ret = ini_errobj_add_msg(errobj, + "[%s]: %s", + sections[i], + ini_errobj_get_msg(localerr)); + if (ret != EOK) { + goto done; + } + ini_errobj_next(localerr); + } + + ini_errobj_destroy(&localerr); + } + } + + ret = EOK; +done: + ini_free_section_list(sections); + ini_errobj_destroy(&localerr); + return ret; +} + +/* This is just convenience function, so that + * we manipulate with ini_rules_* functions. */ +void ini_rules_destroy(struct ini_cfgobj *rules) +{ + ini_config_destroy(rules); +} + +int ini_errobj_create(struct ini_errobj **_errobj) +{ + struct ini_errobj *new_errobj = NULL; + + if (_errobj == NULL) { + return EINVAL; + } + + new_errobj = calloc(1, sizeof(struct ini_errobj)); + if (new_errobj == NULL) { + return ENOMEM; + } + + *_errobj = new_errobj; + return EOK; +} + +void ini_errobj_destroy(struct ini_errobj **errobj) +{ + struct ini_errmsg *to_remove; + + if (errobj == NULL || *errobj == NULL) { + return; + } + + while ((*errobj)->first_msg) { + to_remove = (*errobj)->first_msg; + (*errobj)->first_msg = (*errobj)->first_msg->next; + free(to_remove->str); + free(to_remove); + } + + free(*errobj); + *errobj = NULL; +} + +int ini_errobj_add_msg(struct ini_errobj *errobj, const char *format, ...) +{ + int ret; + va_list args; + struct ini_errmsg *new; + + new = calloc(1, sizeof(struct ini_errmsg)); + if (new == NULL) { + return ENOMEM; + } + + va_start(args, format); + ret = vasprintf(&new->str, format, args); + va_end(args); + if (ret == -1) { + free(new); + return ENOMEM; + } + + if (errobj->count == 0) { + /* First addition to the list, all pointers are NULL */ + errobj->first_msg = new; + errobj->last_msg = new; + errobj->cur_msg = new; + errobj->count++; + } else { + errobj->last_msg->next = new; + errobj->last_msg = errobj->last_msg->next; + errobj->count++; + } + + return EOK; +} + +void ini_errobj_reset(struct ini_errobj *errobj) +{ + errobj->cur_msg = errobj->first_msg; +} + +const char *ini_errobj_get_msg(struct ini_errobj *errobj) +{ + if (errobj->cur_msg != NULL) { + return errobj->cur_msg->str; + } + + /* Should this be allowed? */ + return NULL; +} + +void ini_errobj_next(struct ini_errobj *errobj) +{ + if (errobj->cur_msg != NULL) { + errobj->cur_msg = errobj->cur_msg->next; + } + + /* If we can not move next, just return */ + return; +} + +int ini_errobj_no_more_msgs(struct ini_errobj *errobj) +{ + return errobj->cur_msg == NULL; +} + +size_t ini_errobj_count(struct ini_errobj *errobj) +{ + return errobj->count; +} diff -Nru ding-libs-0.5.0/ini/ini_configobj.h ding-libs-0.6.0/ini/ini_configobj.h --- ding-libs-0.5.0/ini/ini_configobj.h 2015-06-23 12:12:00.000000000 +0000 +++ ding-libs-0.6.0/ini/ini_configobj.h 2016-06-22 10:03:58.000000000 +0000 @@ -32,6 +32,14 @@ #include "simplebuffer.h" #include "ini_valueobj.h" +#ifndef DING_ATTR_FORMAT +# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) +# define DING_ATTR_FORMAT(fmt, args) __attribute__((__format__(__printf__, fmt, args))) +# else +# define DING_ATTR_FORMAT(fmt, args) +# endif +#endif + /** @mainpage The INI configuration interface * * The goal of the this interface is to allow applications @@ -363,6 +371,8 @@ #define INI_PARSE_NOTAB 0x0004 /** @brief Do not allow C-style comments */ #define INI_PARSE_NO_C_COMMENTS 0x0008 +/** @brief Skip lines that are not KVPs */ +#define INI_PARSE_IGNORE_NON_KVP 0x0010 /** * @} @@ -1005,7 +1015,8 @@ * * Function merges the main configuration file * with the configuration file snippets - * read from a specified directory. + * read from a specified directory + * ordered according to the locale setting. * * @param[in] base_cfg A configuration object * that will be augmented. @@ -2045,6 +2056,185 @@ */ void ini_free_double_config_array(double *array); +/** @brief Structure that holds error messages + * generated by validators. + */ +struct ini_errobj; + +/** + * @brief Create structure to hold error messages. + * + * This function initiates structure that can be used to + * hold error messages from generators. To add messages to + * the structure use \ref ini_errobj_add_msg. + * + * @param[out] errobj container for errors. + * + * @return Zero on success, nonzero value in case of error. + */ +int ini_errobj_create(struct ini_errobj **_errobj); + +/** + * @brief Free structure that holds error messages. + * + * This function is used to free structure + * previously created by \ref ini_errobj_create. + * + * @param[in] errobj container for errors. + */ +void ini_errobj_destroy(struct ini_errobj **errobj); + +/** + * @brief Add new printf formated message to errobj. + * + * This function initiates structure that can be used to + * hold error messages from generators. To add messages to + * the structure use \ref ini_errobj_add_msg. + * + * @param[in] errobj container for errors previously + * created by \ref ini_errobj_create. + * @param[in] format printf format string + * + * @return Zero on success, nonzero value in case of error. + */ +int ini_errobj_add_msg(struct ini_errobj *errobj, + const char *format, ...) + DING_ATTR_FORMAT(2, 3); + +/** + * @brief Reset iterator in errobj. + * + * After calling this function, the iterator in errobj + * will point to the first error message. Use this if + * you need to accesss the list multiple times in a loop. + * + * @param[in] errobj container for errors previously + * created by \ref ini_errobj_create. + */ +void ini_errobj_reset(struct ini_errobj *errobj); + +/** + * @brief Get pointer to current message in errobj. + * + * This function returns pointer to current message + * pointed by the internal iterator. The returned string can + * not be changed and will point to valid data only + * until \ref ini_errobj_destroy is called. + * + * @param[in] errobj container for errors previously + * created by \ref ini_errobj_create. + * @return String inside the errobj structure. String + * is valid until errobj is destroyed. + */ +const char *ini_errobj_get_msg(struct ini_errobj *errobj); + +/** + * @brief Move to the next message in errobj. + * + * This function moves the internal iterator of errobj + * to the next message in list. + * + * @param[in] errobj container for errors previously + * created by \ref ini_errobj_create. + */ +void ini_errobj_next(struct ini_errobj *errobj); + +/** + * @brief Check if errobj has more messages. + * + * This function returns true if errobj's internal iterator + * reached end of list and no longer points to a message + * + * @param[in] errobj container for errors previously + * created by \ref ini_errobj_create. + * @return True if internal iterator reached end of list. + */ +int ini_errobj_no_more_msgs(struct ini_errobj *errobj); + +/** + * @brief Return number of messages in errobj + * + * This function returns number of messages inside errobj + * + * @param[in] errobj container for errors previously + * created by \ref ini_errobj_create. + * @return Number of messages stored in errobj. + */ +size_t ini_errobj_count(struct ini_errobj *errobj); + +typedef int (ini_validator_func)(const char *rule_name, + struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_errobj *errobj, + void **data); + +typedef int (ini_schema_validator_func)(const char *rule_name, + struct ini_cfgobj *rules_obj, + struct ini_errobj *errobj, + void **data); + +/** @brief Structure used to define application specific + * (external to libini) validator + */ +struct ini_validator { + const char *name; + ini_validator_func *func; + /* currently unused, for future expansion */ + ini_schema_validator_func *schema_validator; +}; + +/** + * @brief Read rules from INI file + * + * This function is used to read rules from INI file + * and store them in config object. This special + * config object is passed to \ref ini_rules_check + * together with config object representing the + * configuration that will be checked. + * + * @param[in] filename Name of file with rules + * @param[out] _rules_obj config object representing the rules + * @return Zero on success. Non zero value on error. + */ +int ini_rules_read_from_file(const char *filename, + struct ini_cfgobj **_rules_obj); + +/** + * @brief Check configuration file using rules + * + * This function is used to check if configuration + * file applies to rules previously loaded by + * \ref ini_rules_read_from_file. Any errors + * detected in the configuration are stored in the + * errobj structure. Error code returned by this + * function indicates some internal error with + * validators or memory allocation error (not + * rule violation). + * + * @param[in] rules_obj config object representing the rules + * @param[in] config_obj config object representing the + * configuration + * @param[in] extra_validators NULL terminated array of external + * validators. Can be NULL if no external + * validators are used. + * + * @param[in] errobj errobj to store generated errors + * from validators. + * + * @return Zero on success. Non zero value on error. + */ +int ini_rules_check(struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_validator **extra_validators, + struct ini_errobj *errobj); + +/** + * @brief Free the rules + * + * This function is just wrapper around ini_config_destroy + */ +void ini_rules_destroy(struct ini_cfgobj *ini_config); + /** * @} */ diff -Nru ding-libs-0.5.0/ini/ini_config.pc ding-libs-0.6.0/ini/ini_config.pc --- ding-libs-0.5.0/ini/ini_config.pc 2015-06-23 14:49:02.000000000 +0000 +++ ding-libs-0.6.0/ini/ini_config.pc 2016-06-22 10:21:00.000000000 +0000 @@ -5,7 +5,7 @@ Name: ini_config Description: Library to process config files in INI format into a libcollection data structure -Version: 1.2.0 +Version: 1.3.0 Requires: basicobjects ref_array collection Libs: -L${libdir} -lini_config Cflags: -I${includedir} diff -Nru ding-libs-0.5.0/ini/ini_config_priv.h ding-libs-0.6.0/ini/ini_config_priv.h --- ding-libs-0.5.0/ini/ini_config_priv.h 2015-06-23 12:12:00.000000000 +0000 +++ ding-libs-0.6.0/ini/ini_config_priv.h 2016-06-22 10:03:58.000000000 +0000 @@ -109,5 +109,18 @@ mode_t mode, mode_t mask); +struct ini_errmsg; + +struct ini_errobj { + size_t count; + struct ini_errmsg *first_msg; + struct ini_errmsg *last_msg; + struct ini_errmsg *cur_msg; +}; + +struct ini_errmsg { + char *str; + struct ini_errmsg *next; +}; #endif diff -Nru ding-libs-0.5.0/ini/ini_parse.c ding-libs-0.6.0/ini/ini_parse.c --- ding-libs-0.5.0/ini/ini_parse.c 2015-06-23 12:12:00.000000000 +0000 +++ ding-libs-0.6.0/ini/ini_parse.c 2016-06-22 10:03:58.000000000 +0000 @@ -966,17 +966,38 @@ /* Check if we have the key */ if (*(str) == '=') { TRACE_ERROR_STRING("No key", str); - po->last_error = ERR_NOKEY; - *action = PARSE_ERROR; + + if (po->parse_flags & INI_PARSE_IGNORE_NON_KVP) { + /* Clean everything as if nothing happened */ + free(po->last_read); + po->last_read = NULL; + po->last_read_len = 0; + *action = PARSE_READ; + } else { + po->last_error = ERR_NOKEY; + *action = PARSE_ERROR; + } + + TRACE_FLOW_EXIT(); return EOK; } /* Find "=" */ eq = strchr(str, '='); if (eq == NULL) { - TRACE_ERROR_STRING("No equal sign", str); - po->last_error = ERR_NOEQUAL; - *action = PARSE_ERROR; + if (po->parse_flags & INI_PARSE_IGNORE_NON_KVP) { + /* Clean everything as if nothing happened */ + free(po->last_read); + po->last_read = NULL; + po->last_read_len = 0; + *action = PARSE_READ; + } else { + TRACE_ERROR_STRING("No equal sign", str); + po->last_error = ERR_NOEQUAL; + *action = PARSE_ERROR; + } + + TRACE_FLOW_EXIT(); return EOK; } @@ -992,6 +1013,7 @@ TRACE_ERROR_STRING("Key name is too long", str); po->last_error = ERR_LONGKEY; *action = PARSE_ERROR; + TRACE_FLOW_EXIT(); return EOK; } @@ -1000,6 +1022,7 @@ error = complete_value_processing(po); if (error) { TRACE_ERROR_NUMBER("Failed to complete value processing", error); + TRACE_FLOW_EXIT(); return error; } } @@ -1008,6 +1031,7 @@ po->key = malloc(len + 1); if (!(po->key)) { TRACE_ERROR_NUMBER("Failed to dup key", ENOMEM); + TRACE_FLOW_EXIT(); return ENOMEM; } @@ -1034,6 +1058,7 @@ dupval = malloc(len + 1); if (!dupval) { TRACE_ERROR_NUMBER("Failed to dup value", ENOMEM); + TRACE_FLOW_EXIT(); return ENOMEM; } @@ -1046,6 +1071,7 @@ if (error) { TRACE_ERROR_NUMBER("Failed to create arrays", error); free(dupval); + TRACE_FLOW_EXIT(); return error; } @@ -1058,6 +1084,7 @@ if (error) { TRACE_ERROR_NUMBER("Failed to add value to arrays", error); free(dupval); + TRACE_FLOW_EXIT(); return error; } diff -Nru ding-libs-0.5.0/ini/ini_parse_ut_check.c ding-libs-0.6.0/ini/ini_parse_ut_check.c --- ding-libs-0.5.0/ini/ini_parse_ut_check.c 1970-01-01 00:00:00.000000000 +0000 +++ ding-libs-0.6.0/ini/ini_parse_ut_check.c 2016-06-22 10:03:58.000000000 +0000 @@ -0,0 +1,152 @@ +/* + INI LIBRARY + + Check based unit test for ini parser. + + Copyright (C) Michal Zidek 2016 + + INI Library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + INI Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with INI Library. If not, see . +*/ + +#include "config.h" + +#include +#include +#include +#include + +/* #define TRACE_LEVEL 7 */ +#define TRACE_HOME +#include "trace.h" +#include "ini_configobj.h" +#include "ini_config_priv.h" + +#define TEST_DIR_PATH "" + +START_TEST(test_ini_parse_non_kvp) +{ + int ret; + struct ini_cfgobj *ini_cfg; + int value; + struct ini_cfgfile *file_ctx; + struct value_obj *vo; + char non_kvp_cfg[] = + "[section_before]\n" + "one = 1\n" + + "[section_non_kvp]\n" + "two = 2\n" + "non_kvp\n" + "three = 3\n" + "=nonkvp\n" + + "[section_after]\n" + "four = 4\n"; + + ret = ini_config_file_from_mem(non_kvp_cfg, strlen(non_kvp_cfg), + &file_ctx); + fail_unless(ret == EOK, "Failed to load config. Error %d.\n", ret); + + /* First try without the INI_PARSE_IGNORE_NON_KVP. This should fail + * with error. */ + ret = ini_config_create(&ini_cfg); + fail_unless(ret == EOK, "Failed to create config. Error %d.\n", ret); + ret = ini_config_parse(file_ctx, INI_STOP_ON_ERROR, INI_MV1S_ALLOW, 0, + ini_cfg); + fail_if(ret != 5, "Expected error was not found.\n"); + + ini_config_destroy(ini_cfg); + ini_config_file_destroy(file_ctx); + + /* Now try with INI_PARSE_IGNORE_NON_KVP. We should have no errors + * and all the surounding configuration should be valid */ + ret = ini_config_file_from_mem(non_kvp_cfg, strlen(non_kvp_cfg), + &file_ctx); + fail_unless(ret == EOK, "Failed to load config. Error %d.\n", ret); + ret = ini_config_create(&ini_cfg); + fail_unless(ret == EOK, "Failed to create config. Error %d.\n", ret); + ret = ini_config_parse(file_ctx, INI_STOP_ON_ERROR, INI_MV1S_ALLOW, + INI_PARSE_IGNORE_NON_KVP, + ini_cfg); + fail_unless(ret == EOK, "ini_config_parse returned %d\n", ret); + + /* Now check if the surrounding configuration is OK */ + /* section_before */ + ret = ini_get_config_valueobj("section_before", "one", ini_cfg, + INI_GET_FIRST_VALUE, &vo); + fail_unless(ret == EOK, "ini_get_config_valueobj returned %d\n: %s", ret, + strerror(ret)); + + value = ini_get_int_config_value(vo, 1, -1, &ret); + fail_unless(ret == EOK, "ini_get_int_config_value returned %d\n: %s", ret, + strerror(ret)); + + fail_unless(ret == EOK); + fail_if(value != 1, "Expected value 1 got %d\n", value); + + /* section_non_kvp */ + ret = ini_get_config_valueobj("section_non_kvp", "two", ini_cfg, + INI_GET_FIRST_VALUE, &vo); + fail_unless(ret == EOK); + + value = ini_get_int_config_value(vo, 1, -1, &ret); + fail_unless(ret == EOK); + fail_if(value != 2, "Expected value 2 got %d\n", value); + + ret = ini_get_config_valueobj("section_non_kvp", "three", ini_cfg, + INI_GET_FIRST_VALUE, &vo); + fail_unless(ret == EOK); + + value = ini_get_int_config_value(vo, 1, -1, &ret); + fail_unless(ret == EOK); + fail_if(value != 3, "Expected value 3 got %d\n", value); + + /* section_after */ + ret = ini_get_config_valueobj("section_after", "four", ini_cfg, + INI_GET_FIRST_VALUE, &vo); + fail_unless(ret == EOK); + + value = ini_get_int_config_value(vo, 1, -1, &ret); + fail_unless(ret == EOK); + fail_if(value != 4, "Expected value 4 got %d\n", value); + + ini_config_destroy(ini_cfg); + ini_config_file_destroy(file_ctx); +} +END_TEST + +static Suite *ini_parse_suite(void) +{ + Suite *s = suite_create("ini_parse_suite"); + + TCase *tc_parse = tcase_create("ini_parse"); + tcase_add_test(tc_parse, test_ini_parse_non_kvp); + + suite_add_tcase(s, tc_parse); + + return s; +} + +int main(void) +{ + int number_failed; + + Suite *s = ini_parse_suite(); + SRunner *sr = srunner_create(s); + /* If CK_VERBOSITY is set, use that, otherwise it defaults to CK_NORMAL */ + srunner_run_all(sr, CK_ENV); + number_failed = srunner_ntests_failed(sr); + srunner_free(sr); + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff -Nru ding-libs-0.5.0/ini/ini_validators_ut_check.c ding-libs-0.6.0/ini/ini_validators_ut_check.c --- ding-libs-0.5.0/ini/ini_validators_ut_check.c 1970-01-01 00:00:00.000000000 +0000 +++ ding-libs-0.6.0/ini/ini_validators_ut_check.c 2016-06-22 10:03:58.000000000 +0000 @@ -0,0 +1,1091 @@ +/* + INI LIBRARY + + Unit test for the configuration file validators API. + + Copyright (C) Michal Zidek 2016 + + INI Library is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + INI Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with INI Library. If not, see . +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* #define TRACE_LEVEL 7 */ +#define TRACE_HOME +#include "trace.h" +#include "ini_configobj.h" +#include "ini_config_priv.h" + +#define TEST_DIR_PATH "" +#define TEST_RULES_FILE TEST_DIR_PATH"test_rules.ini" + +static void create_rules_from_str(const char *rules, + struct ini_cfgobj **_rules_obj) +{ + FILE *file; + size_t written; + int ret; + + /* We want to test actual reading from file using + * ini_rules_read_from_file, so we create the file here */ + file = fopen(TEST_RULES_FILE, "w"); + fail_if(file == NULL, "fopen() failed: %s", strerror(errno)); + written = fwrite(rules, 1, strlen(rules), file); + fail_unless(written == strlen(rules)); + + /* allow reading */ + ret = chmod(TEST_RULES_FILE, 0664); + fail_unless(ret == 0, "chmod() failed: %s", strerror(errno)); + + fclose(file); + + ret = ini_rules_read_from_file(TEST_RULES_FILE, _rules_obj); + fail_unless(ret == 0, "read_rules_from_file() failed: %s", strerror(ret)); +} + +static struct ini_cfgobj *get_ini_config_from_str(char input_data[], + size_t input_data_len) +{ + struct ini_cfgobj *in_cfg; + struct ini_cfgfile *file_ctx; + int ret; + + ret = ini_config_create(&in_cfg); + fail_unless(ret == EOK, "Failed to create config. Error %d.\n", ret); + + ret = ini_config_file_from_mem(input_data, input_data_len, &file_ctx); + fail_unless(ret == EOK, "Failed to load config. Error %d.\n", ret); + + ret = ini_config_parse(file_ctx, INI_STOP_ON_NONE, INI_MV1S_ALLOW, 0, + in_cfg); + fail_unless(ret == EOK, "Failed to parse config. Error %d.\n", ret); + + ini_config_file_destroy(file_ctx); + + return in_cfg; +} + +START_TEST(test_ini_errobj) +{ + struct ini_errobj *errobj; + int ret; + const char TEST_MSG1[] = "Test message one."; + const char TEST_MSG2[] = "Test message two."; + const char TEST_MSG3[] = "Test message three."; + + ret = ini_errobj_create(NULL); + fail_unless(ret == EINVAL, + "ini_errobj_create(NULL) failed with wrong error [%s]", + strerror(ret)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + /* We just created the errobj, it should be empty */ + fail_unless(ini_errobj_no_more_msgs(errobj)); + + /* Now add three messages, after adding each message, + * check if the errobj has correct content. */ + ret = ini_errobj_add_msg(errobj, TEST_MSG1); + fail_if(ret != 0, "ini_errobj_add_msg() failed: %s", strerror(ret)); + fail_if(ini_errobj_no_more_msgs(errobj)); + ret = strcmp(TEST_MSG1, ini_errobj_get_msg(errobj)); + fail_if(ret != 0, "TEST_MSG1 was not found."); + ini_errobj_next(errobj); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ret = ini_errobj_add_msg(errobj, TEST_MSG2); + fail_if(ret != 0, "ini_errobj_add_msg() failed: %s", strerror(ret)); + ini_errobj_reset(errobj); /* strart from first message */ + fail_if(ini_errobj_no_more_msgs(errobj)); + ret = strcmp(TEST_MSG1, ini_errobj_get_msg(errobj)); + fail_if(ret != 0, "TEST_MSG1 was not found."); + ini_errobj_next(errobj); + fail_if(ini_errobj_no_more_msgs(errobj)); + ret = strcmp(TEST_MSG2, ini_errobj_get_msg(errobj)); + fail_if(ret != 0, "TEST_MSG2 was not found."); + ini_errobj_next(errobj); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ret = ini_errobj_add_msg(errobj, TEST_MSG3); + fail_if(ret != 0, "ini_errobj_add_msg() failed: %s", strerror(ret)); + ini_errobj_reset(errobj); /* strart from first message */ + fail_if(ini_errobj_no_more_msgs(errobj)); + ret = strcmp(TEST_MSG1, ini_errobj_get_msg(errobj)); + fail_if(ret != 0, "TEST_MSG1 was not found."); + ini_errobj_next(errobj); + fail_if(ini_errobj_no_more_msgs(errobj)); + ret = strcmp(TEST_MSG2, ini_errobj_get_msg(errobj)); + fail_if(ret != 0, "TEST_MSG2 was not found."); + ini_errobj_next(errobj); + fail_if(ini_errobj_no_more_msgs(errobj)); + ret = strcmp(TEST_MSG3, ini_errobj_get_msg(errobj)); + fail_if(ret != 0, "TEST_MSG3 was not found."); + ini_errobj_next(errobj); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); +} +END_TEST + +START_TEST(test_ini_noerror) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + + char input_rules[] = + "[rule/always_succeed]\n" + "validator = ini_dummy_noerror\n"; + + char input_cfg[] = + "[section]\n" + "# Content of this file should not matter\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_ini_error) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + const char *errmsg; + + char input_rules[] = + "[rule/generate_error]\n" + "validator = ini_dummy_error\n"; + + char input_wrong_rule[] = + "[rule/generate_error]\n" + "valid = ini_dummy_error\n"; + + char input_cfg[] = + "[section]\n" + "# Content of this file should not matter\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate exactly one error */ + fail_if(ini_errobj_no_more_msgs(errobj)); + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, "[rule/generate_error]: Error"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + ini_rules_destroy(rules_obj); + + /* test rule with missing validator */ + create_rules_from_str(input_wrong_rule, &rules_obj); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate exactly one error */ + fail_if(ini_errobj_no_more_msgs(errobj)); + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, "Rule 'rule/generate_error' has no validator."); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + ini_rules_destroy(rules_obj); + ini_config_destroy(cfg_obj); +} +END_TEST + +START_TEST(test_unknown_validator) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + + char input_rules[] = + "[rule/always_succeed]\n" + "validator = nonexistent_validator\n"; + + char input_cfg[] = + "[section]\n" + "# Content of this file should not matter\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate exactly one error */ + fail_if(ini_errobj_no_more_msgs(errobj)); + ini_errobj_next(errobj); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +static int custom_noerror(const char *rule_name, + struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_errobj *errobj, + void **data) +{ + return 0; +} + +static int custom_error(const char *rule_name, + struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_errobj *errobj, + void **data) +{ + return ini_errobj_add_msg(errobj, "Error"); +} + +START_TEST(test_custom_noerror) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + struct ini_validator *noerror[] = { + &(struct ini_validator){ "custom_noerror", custom_noerror, NULL }, + NULL + }; + struct ini_validator *missing_name[] = { + &(struct ini_validator){ NULL, custom_noerror, NULL }, + &(struct ini_validator){ "custom_noerror", custom_noerror, NULL }, + NULL + }; + + char input_rules[] = + "[rule/custom_succeed]\n" + "validator = custom_noerror\n"; + + char input_cfg[] = + "[section]\n" + "# Content of this file should not matter\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + /* Pass the custom validator to ini_rules_check() */ + ret = ini_rules_check(rules_obj, cfg_obj, noerror, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate no errors */ + fail_unless(ini_errobj_no_more_msgs(errobj)); + + /* Pass wrong external validator to ini_rules_check() */ + /* It should be skipped */ + ret = ini_rules_check(rules_obj, cfg_obj, missing_name, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate no errors */ + fail_unless(ini_errobj_no_more_msgs(errobj), "%s", ini_errobj_get_msg(errobj)); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_custom_error) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + struct ini_validator *error[] = { + &(struct ini_validator){ "custom_error", custom_error, NULL }, + NULL + }; + struct ini_validator *missing_function[] = { + &(struct ini_validator){ "custom_noerror", NULL, NULL }, + NULL + }; + const char *errmsg; + + char input_rules[] = + "[rule/custom_error]\n" + "validator = custom_error\n"; + + char input_cfg[] = + "[section]\n" + "# Content of this file should not matter\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + /* Pass the custom validator to ini_rules_check() */ + ret = ini_rules_check(rules_obj, cfg_obj, error, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate one error */ + fail_if(ini_errobj_no_more_msgs(errobj)); + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, "[rule/custom_error]: Error"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + /* Pass the custom validator to ini_rules_check() */ + ret = ini_rules_check(rules_obj, cfg_obj, missing_function, errobj); + + /* Should generate one error for missing validator */ + fail_if(ini_errobj_no_more_msgs(errobj)); + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, + "Rule 'rule/custom_error' uses unknown validator " + "'custom_error'."); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + + ini_rules_destroy(rules_obj); + ini_config_destroy(cfg_obj); +} +END_TEST + +START_TEST(test_ini_allowed_options_ok) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + + /* Only bar and baz are allowed for foo section */ + char input_rules[] = + "[rule/options_for_foo]\n" + "validator = ini_allowed_options\n" + "section_re = ^foo$\n" + "option = bar\n" + "option = baz\n"; + + /* Should check only foo section, other sections are + * irrelevant and can contain any option */ + char input_cfg[] = + "[foo]\n" + "bar = 0\n" + "baz = 0\n" + "[oof]\n" + "opt1 = 1\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate no errors */ + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_ini_allowed_options_no_section) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + size_t num_err; + const char *errmsg; + + /* Ommit section_re to generate error */ + char input_rules[] = + "[rule/options_for_foo]\n" + "validator = ini_allowed_options\n" + /* "section_re = ^foo$\n" */ + "option = bar\n" + "option = baz\n"; + + /* section_re without value */ + char input_rules2[] = + "[rule/options_for_foo]\n" + "validator = ini_allowed_options\n" + "section_re = \n" + "option = bar\n" + "option = baz\n"; + + /* Make 4 typos */ + char input_cfg[] = + "[foo]\n" + "bar = 0\n" + "baz = 0\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 2 errors (one from rules_check and one + * from the validator itself) */ + fail_if(ini_errobj_no_more_msgs(errobj)); + + num_err = ini_errobj_count(errobj); + fail_unless(num_err == 2, "Expected 2 errors, got %d", num_err); + + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, + "Rule 'rule/options_for_foo' returned error code '22'"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, + "[rule/options_for_foo]: Validator misses 'section_re' " + "parameter"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + ini_rules_destroy(rules_obj); + + /* the second test with missing value for section_re */ + + create_rules_from_str(input_rules2, &rules_obj); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 2 errors (one from rules_check and one + * from the validator itself) */ + fail_if(ini_errobj_no_more_msgs(errobj)); + + num_err = ini_errobj_count(errobj); + fail_unless(num_err == 2, "Expected 2 errors, got %d", num_err); + + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, + "Rule 'rule/options_for_foo' returned error code '22'"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, + "[rule/options_for_foo]: Validator misses 'section_re' " + "parameter"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + ini_rules_destroy(rules_obj); + + ini_config_destroy(cfg_obj); +} +END_TEST + +START_TEST(test_ini_allowed_options_wrong_regex) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + size_t num_err; + const char *errmsg; + + /* Ommit section_re to generate error */ + char input_rules[] = + "[rule/options_for_foo]\n" + "validator = ini_allowed_options\n" + "section_re = ^foo[$\n" + "option = bar\n" + "option = baz\n"; + + /* Make 4 typos */ + char input_cfg[] = + "[foo]\n" + "bar = 0\n" + "baz = 0\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 2 errors (one from rules_check and one + * from the validator itself) */ + fail_if(ini_errobj_no_more_msgs(errobj)); + + num_err = ini_errobj_count(errobj); + fail_unless(num_err == 2, "Expected 2 errors, got %d", num_err); + + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, + "Rule 'rule/options_for_foo' returned error code '22'"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, + "[rule/options_for_foo]: Cannot compile regular expression " + "from option 'section_re'. " + "Error: 'Unmatched [ or [^'"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_ini_allowed_options_typos) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + size_t num_err; + + /* Only bar and baz are allowed for foo section */ + char input_rules[] = + "[rule/options_for_foo]\n" + "validator = ini_allowed_options\n" + "section_re = ^foo$\n" + "option = bar\n" + "option = baz\n"; + + /* Make 4 typos */ + char input_cfg[] = + "[foo]\n" + "br = 0\n" + "bra = 0\n" + "abr = 0\n" + "abz = 0\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 4 errors */ + fail_if(ini_errobj_no_more_msgs(errobj)); + + num_err = ini_errobj_count(errobj); + fail_unless(num_err == 4, "Expected 4 errors, got %d", num_err); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_ini_allowed_sections_str_ok) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + + /* Only bar and baz are allowed for foo section */ + char input_rules[] = + "[rule/section_list]\n" + "validator = ini_allowed_sections\n" + "section = foo\n" + "section = bar\n"; + + /* Make 4 typos */ + char input_cfg[] = + "[foo]\n" + "br = 0\n" + "bra = 0\n" + "[bar]\n" + "abz = 0\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 0 errors */ + fail_unless(ini_errobj_no_more_msgs(errobj), + "Unexpected errors found: [%s]", ini_errobj_get_msg(errobj)); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_ini_allowed_sections_str_typos) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int num_err; + int ret; + + /* Only bar and baz are allowed for foo section */ + char input_rules[] = + "[rule/section_list]\n" + "validator = ini_allowed_sections\n" + "section = foo\n" + "section = bar\n"; + + /* Make 4 typos */ + char input_cfg[] = + "[fooo]\n" + "br = 0\n" + "bra = 0\n" + "[baar]\n" + "abz = 0\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 2 errors */ + fail_if(ini_errobj_no_more_msgs(errobj), + "Expected 2 errors but none found"); + num_err = ini_errobj_count(errobj); + fail_unless(num_err == 2, "Expected 2 errors, got %d", num_err); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_ini_allowed_sections_str_insensitive) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + int i; + + /* Only bar and baz are allowed for foo section */ + char input_rules_template[] = + "[rule/section_list]\n" + "validator = ini_allowed_sections\n" + "case_insensitive = %s\n" + "section = foo\n" + "section = bar\n"; + + char input_rules[sizeof(input_rules_template) + 10]; + + const char *case_insensitive_values[] = { "yes", "Yes", "true", "True", + "1", NULL }; + /* Make 4 typos */ + char input_cfg[] = + "[FOo]\n" + "br = 0\n" + "bra = 0\n" + "[baR]\n" + "abz = 0\n"; + + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + for (i = 0; case_insensitive_values[i] != NULL; i++) { + sprintf(input_rules, input_rules_template, case_insensitive_values[i]); + + create_rules_from_str(input_rules, &rules_obj); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, + "ini_errobj_create() failed for case_insensitive = %s: %s", + case_insensitive_values[i], strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, + "ini_rules_check() failed for case_insensitive = %s: %s", + case_insensitive_values[i], strerror(ret)); + + /* Should generate 0 errors */ + fail_unless(ini_errobj_no_more_msgs(errobj), + "Unexpected errors found for case_insensitive = %s: [%s]", + case_insensitive_values[i], ini_errobj_get_msg(errobj)); + + ini_errobj_destroy(&errobj); + ini_rules_destroy(rules_obj); + } + + ini_config_destroy(cfg_obj); +} +END_TEST + +START_TEST(test_ini_allowed_sections_re_ok) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + + char input_rules[] = + "[rule/section_list]\n" + "validator = ini_allowed_sections\n" + "section_re = ^foo*$\n" + "section_re = bar\n"; + + char input_cfg[] = + "[foooooooooooo]\n" + "br = 0\n" + "bra = 0\n" + "[my_bar]\n" + "abz = 0\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 0 errors */ + fail_unless(ini_errobj_no_more_msgs(errobj), "Unexpected errors found"); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_ini_allowed_sections_re_typos) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int num_err; + int ret; + + char input_rules[] = + "[rule/section_list]\n" + "validator = ini_allowed_sections\n" + "section_re = ^foo*$\n" + "section_re = bar\n"; + + /* Make 4 typos */ + char input_cfg[] = + "[fooooooOooooo]\n" + "br = 0\n" + "bra = 0\n" + "[my_bra]\n" + "abz = 0\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 2 errors */ + fail_if(ini_errobj_no_more_msgs(errobj), + "Expected 2 errors but none found"); + num_err = ini_errobj_count(errobj); + fail_unless(num_err == 2, "Expected 2 errors, got %d", num_err); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_ini_allowed_sections_re_insensitive) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int ret; + + /* Only bar and baz are allowed for foo section */ + char input_rules[] = + "[rule/section_list]\n" + "validator = ini_allowed_sections\n" + "case_insensitive = yes\n" + "section_re = ^foo*$\n" + "section_re = bar\n"; + + /* Make 4 typos */ + char input_cfg[] = + "[FOoOoOoOoOOOOooo]\n" + "br = 0\n" + "bra = 0\n" + "[my_Bar]\n" + "abz = 0\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 0 errors */ + fail_unless(ini_errobj_no_more_msgs(errobj), "Unexpected errors found"); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_ini_allowed_sections_missing_section) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int num_err; + int ret; + const char *errmsg; + + /* Only bar and baz are allowed for foo section */ + char input_rules[] = + "[rule/section_list]\n" + "validator = ini_allowed_sections\n"; + + /* Make 4 typos */ + char input_cfg[] = + "[fooo]\n" + "br = 0\n" + "bra = 0\n" + "[baar]\n" + "abz = 0\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 1 errors */ + fail_if(ini_errobj_no_more_msgs(errobj), + "Expected 1 errors but none found"); + num_err = ini_errobj_count(errobj); + fail_unless(num_err == 1, "Expected 1 errors, got %d", num_err); + + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, + "[rule/section_list]: No allowed sections specified. " + "Use 'section = default' to allow only default section"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +START_TEST(test_ini_allowed_sections_wrong_regex) +{ + struct ini_cfgobj *rules_obj; + struct ini_cfgobj *cfg_obj; + struct ini_errobj *errobj; + int num_err; + int ret; + const char *errmsg; + + /* Only bar and baz are allowed for foo section */ + char input_rules[] = + "[rule/section_list]\n" + "validator = ini_allowed_sections\n" + "section_re = ^foo\\(*$\n"; + + /* Make 4 typos */ + char input_cfg[] = + "[fooo]\n" + "br = 0\n" + "bra = 0\n" + "[baar]\n" + "abz = 0\n"; + + create_rules_from_str(input_rules, &rules_obj); + cfg_obj = get_ini_config_from_str(input_cfg, sizeof(input_cfg)); + + ret = ini_errobj_create(&errobj); + fail_unless(ret == 0, "ini_errobj_create() failed: %s", strerror(ret)); + + ret = ini_rules_check(rules_obj, cfg_obj, NULL, errobj); + fail_unless(ret == 0, "ini_rules_check() failed: %s", strerror(ret)); + + /* Should generate 2 errors */ + fail_if(ini_errobj_no_more_msgs(errobj), + "Expected 2 errors but none found"); + num_err = ini_errobj_count(errobj); + fail_unless(num_err == 2, "Expected 2 errors, got %d", num_err); + + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, + "Rule 'rule/section_list' returned error code '22'"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + + errmsg = ini_errobj_get_msg(errobj); + ret = strcmp(errmsg, + "[rule/section_list]: Validator failed to use regex " + "[^foo\\(*$]:[Unmatched ( or \\(]"); + fail_unless(ret == 0, "Got msg: [%s]", errmsg); + ini_errobj_next(errobj); + + fail_unless(ini_errobj_no_more_msgs(errobj)); + + ini_errobj_destroy(&errobj); + ini_config_destroy(cfg_obj); + ini_rules_destroy(rules_obj); +} +END_TEST + +static Suite *ini_validators_utils_suite(void) +{ + Suite *s = suite_create("ini_validators"); + + TCase *tc_infrastructure = tcase_create("infrastructure"); + tcase_add_test(tc_infrastructure, test_ini_errobj); + tcase_add_test(tc_infrastructure, test_ini_noerror); + tcase_add_test(tc_infrastructure, test_ini_error); + tcase_add_test(tc_infrastructure, test_unknown_validator); + tcase_add_test(tc_infrastructure, test_custom_noerror); + tcase_add_test(tc_infrastructure, test_custom_error); + + TCase *tc_allowed_options = tcase_create("ini_allowed_options"); + tcase_add_test(tc_allowed_options, test_ini_allowed_options_ok); + tcase_add_test(tc_allowed_options, test_ini_allowed_options_no_section); + tcase_add_test(tc_allowed_options, test_ini_allowed_options_wrong_regex); + tcase_add_test(tc_allowed_options, test_ini_allowed_options_typos); + + TCase *tc_allowed_sections = tcase_create("ini_allowed_sections"); + tcase_add_test(tc_allowed_sections, test_ini_allowed_sections_str_ok); + tcase_add_test(tc_allowed_sections, test_ini_allowed_sections_str_typos); + tcase_add_test(tc_allowed_sections, + test_ini_allowed_sections_str_insensitive); + tcase_add_test(tc_allowed_sections, test_ini_allowed_sections_re_ok); + tcase_add_test(tc_allowed_sections, test_ini_allowed_sections_re_typos); + tcase_add_test(tc_allowed_sections, + test_ini_allowed_sections_re_insensitive); + tcase_add_test(tc_allowed_sections, + test_ini_allowed_sections_missing_section); + tcase_add_test(tc_allowed_sections, test_ini_allowed_sections_wrong_regex); + + suite_add_tcase(s, tc_infrastructure); + suite_add_tcase(s, tc_allowed_options); + suite_add_tcase(s, tc_allowed_sections); + + return s; +} + +int main(void) +{ + int number_failed; + + Suite *s = ini_validators_utils_suite(); + SRunner *sr = srunner_create(s); + /* If CK_VERBOSITY is set, use that, otherwise it defaults to CK_NORMAL */ + srunner_run_all(sr, CK_ENV); + number_failed = srunner_ntests_failed(sr); + srunner_free(sr); + return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} diff -Nru ding-libs-0.5.0/ini/libini_config.sym ding-libs-0.6.0/ini/libini_config.sym --- ding-libs-0.5.0/ini/libini_config.sym 2015-06-23 12:12:00.000000000 +0000 +++ ding-libs-0.6.0/ini/libini_config.sym 2016-06-22 10:03:58.000000000 +0000 @@ -177,3 +177,18 @@ ini_config_set_bom; } INI_CONFIG_1.1.0; +INI_CONFIG_1.3.0 { +global: + /* ini_configobj.h */ + ini_errobj_create; + ini_errobj_destroy; + ini_errobj_add_msg; + ini_errobj_reset; + ini_errobj_get_msg; + ini_errobj_count; + ini_errobj_next; + ini_errobj_no_more_msgs; + ini_rules_read_from_file; + ini_rules_check; + ini_rules_destroy; +} INI_CONFIG_1.2.0; diff -Nru ding-libs-0.5.0/Makefile.am ding-libs-0.6.0/Makefile.am --- ding-libs-0.5.0/Makefile.am 2015-06-23 12:12:00.000000000 +0000 +++ ding-libs-0.6.0/Makefile.am 2016-06-22 10:03:58.000000000 +0000 @@ -69,8 +69,16 @@ -Wl,--version-script=$(top_srcdir)/path_utils/libpath_utils.sym if HAVE_CHECK - check_PROGRAMS += path_utils_ut ini_configmod_ut_check - TESTS += path_utils_ut ini_configmod_ut_check + check_PROGRAMS += path_utils_ut \ + ini_configmod_ut_check \ + ini_parse_ut_check \ + ini_validators_ut_check \ + $(NULL) + TESTS += path_utils_ut \ + ini_configmod_ut_check \ + ini_parse_ut_check \ + ini_validators_ut_check \ + $(NULL) endif path_utils_ut_SOURCES = path_utils/path_utils_ut.c @@ -268,7 +276,7 @@ libref_array.la \ libbasicobjects.la libini_config_la_LDFLAGS = \ - -version-info 6:0:1 \ + -version-info 7:0:2 \ -Wl,--version-script=$(top_srcdir)/ini/libini_config.sym dist_noinst_DATA += \ @@ -348,6 +356,17 @@ libref_array.la \ $(CHECK_LIBS) +ini_parse_ut_check_SOURCES = ini/ini_parse_ut_check.c +ini_parse_ut_check_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS) +ini_parse_ut_check_LDADD = libini_config.la \ + libref_array.la \ + $(CHECK_LIBS) + +ini_validators_ut_check_SOURCES = ini/ini_validators_ut_check.c +ini_validators_ut_check_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS) +ini_validators_ut_check_LDADD = libini_config.la $(CHECK_LIBS) + + ini_save_ut_SOURCES = ini/ini_save_ut.c ini_save_ut_LDADD = libini_config.la libcollection.la \ libbasicobjects.la libpath_utils.la libref_array.la diff -Nru ding-libs-0.5.0/Makefile.in ding-libs-0.6.0/Makefile.in --- ding-libs-0.5.0/Makefile.in 2015-06-23 14:49:00.000000000 +0000 +++ ding-libs-0.6.0/Makefile.in 2016-06-22 10:20:58.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.13.4 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,7 +17,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -100,32 +110,19 @@ ini_comment_ut$(EXEEXT) ini_valueobj_ut$(EXEEXT) \ ini_parse_ut$(EXEEXT) ini_augment_ut$(EXEEXT) \ ini_configmod_ut$(EXEEXT) ini_save_ut$(EXEEXT) -@HAVE_CHECK_TRUE@am__append_2 = path_utils_ut ini_configmod_ut_check -@HAVE_CHECK_TRUE@am__append_3 = path_utils_ut ini_configmod_ut_check +@HAVE_CHECK_TRUE@am__append_2 = path_utils_ut \ +@HAVE_CHECK_TRUE@ ini_configmod_ut_check \ +@HAVE_CHECK_TRUE@ ini_parse_ut_check \ +@HAVE_CHECK_TRUE@ ini_validators_ut_check \ +@HAVE_CHECK_TRUE@ $(NULL) + +@HAVE_CHECK_TRUE@am__append_3 = path_utils_ut \ +@HAVE_CHECK_TRUE@ ini_configmod_ut_check \ +@HAVE_CHECK_TRUE@ ini_parse_ut_check \ +@HAVE_CHECK_TRUE@ ini_validators_ut_check \ +@HAVE_CHECK_TRUE@ $(NULL) + subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in $(top_srcdir)/contrib/ding-libs.spec.in \ - $(top_srcdir)/path_utils/path_utils.cfg.doxy.in \ - $(top_srcdir)/path_utils/path_utils.pc.in \ - $(top_srcdir)/dhash/dhash.pc.in \ - $(top_srcdir)/collection/collection.cfg.doxy.in \ - $(top_srcdir)/collection/collection.pc.in \ - $(top_srcdir)/refarray/ref_array.cfg.doxy.in \ - $(top_srcdir)/refarray/ref_array.pc.in \ - $(top_srcdir)/basicobjects/basicobjects.cfg.doxy.in \ - $(top_srcdir)/basicobjects/basicobjects.pc.in \ - $(top_srcdir)/ini/ini_config.cfg.doxy.in \ - $(top_srcdir)/ini/ini_config.pc.in $(top_srcdir)/build/depcomp \ - $(dist_doc_DATA) $(dist_examples_DATA) $(dist_noinst_DATA) \ - $(dist_pkgconfig_DATA) $(dist_include_HEADERS) \ - $(top_srcdir)/build/test-driver COPYING COPYING.LESSER README \ - build/ar-lib build/compile build/config.guess build/config.sub \ - build/depcomp build/install-sh build/missing build/ltmain.sh \ - $(top_srcdir)/build/ar-lib $(top_srcdir)/build/compile \ - $(top_srcdir)/build/config.guess \ - $(top_srcdir)/build/config.sub $(top_srcdir)/build/install-sh \ - $(top_srcdir)/build/ltmain.sh $(top_srcdir)/build/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ @@ -133,6 +130,10 @@ $(top_srcdir)/version.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(dist_doc_DATA) $(dist_examples_DATA) \ + $(dist_noinst_DATA) $(dist_pkgconfig_DATA) \ + $(dist_include_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -233,7 +234,9 @@ $(AM_CFLAGS) $(CFLAGS) $(libref_array_la_LDFLAGS) $(LDFLAGS) \ -o $@ @HAVE_CHECK_TRUE@am__EXEEXT_1 = path_utils_ut$(EXEEXT) \ -@HAVE_CHECK_TRUE@ ini_configmod_ut_check$(EXEEXT) +@HAVE_CHECK_TRUE@ ini_configmod_ut_check$(EXEEXT) \ +@HAVE_CHECK_TRUE@ ini_parse_ut_check$(EXEEXT) \ +@HAVE_CHECK_TRUE@ ini_validators_ut_check$(EXEEXT) am_collection_queue_ut_OBJECTS = \ collection/collection_queue_ut.$(OBJEXT) collection_queue_ut_OBJECTS = $(am_collection_queue_ut_OBJECTS) @@ -280,10 +283,29 @@ ini_parse_ut_OBJECTS = $(am_ini_parse_ut_OBJECTS) ini_parse_ut_DEPENDENCIES = libini_config.la libcollection.la \ libbasicobjects.la +am_ini_parse_ut_check_OBJECTS = \ + ini/ini_parse_ut_check-ini_parse_ut_check.$(OBJEXT) +ini_parse_ut_check_OBJECTS = $(am_ini_parse_ut_check_OBJECTS) +ini_parse_ut_check_DEPENDENCIES = libini_config.la libref_array.la \ + $(am__DEPENDENCIES_1) +ini_parse_ut_check_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(ini_parse_ut_check_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ am_ini_save_ut_OBJECTS = ini/ini_save_ut.$(OBJEXT) ini_save_ut_OBJECTS = $(am_ini_save_ut_OBJECTS) ini_save_ut_DEPENDENCIES = libini_config.la libcollection.la \ libbasicobjects.la libpath_utils.la libref_array.la +am_ini_validators_ut_check_OBJECTS = \ + ini/ini_validators_ut_check-ini_validators_ut_check.$(OBJEXT) +ini_validators_ut_check_OBJECTS = \ + $(am_ini_validators_ut_check_OBJECTS) +ini_validators_ut_check_DEPENDENCIES = libini_config.la \ + $(am__DEPENDENCIES_1) +ini_validators_ut_check_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(ini_validators_ut_check_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ am_ini_valueobj_ut_OBJECTS = ini/ini_valueobj_ut.$(OBJEXT) ini_valueobj_ut_OBJECTS = $(am_ini_valueobj_ut_OBJECTS) ini_valueobj_ut_DEPENDENCIES = libini_config.la libbasicobjects.la @@ -342,7 +364,8 @@ $(dhash_test_SOURCES) $(ini_augment_ut_SOURCES) \ $(ini_comment_ut_SOURCES) $(ini_config_ut_SOURCES) \ $(ini_configmod_ut_SOURCES) $(ini_configmod_ut_check_SOURCES) \ - $(ini_parse_ut_SOURCES) $(ini_save_ut_SOURCES) \ + $(ini_parse_ut_SOURCES) $(ini_parse_ut_check_SOURCES) \ + $(ini_save_ut_SOURCES) $(ini_validators_ut_check_SOURCES) \ $(ini_valueobj_ut_SOURCES) $(path_utils_ut_SOURCES) \ $(ref_array_ut_SOURCES) $(simplebuffer_ut_SOURCES) DIST_SOURCES = $(libbasicobjects_la_SOURCES) \ @@ -354,7 +377,8 @@ $(ini_augment_ut_SOURCES) $(ini_comment_ut_SOURCES) \ $(ini_config_ut_SOURCES) $(ini_configmod_ut_SOURCES) \ $(ini_configmod_ut_check_SOURCES) $(ini_parse_ut_SOURCES) \ - $(ini_save_ut_SOURCES) $(ini_valueobj_ut_SOURCES) \ + $(ini_parse_ut_check_SOURCES) $(ini_save_ut_SOURCES) \ + $(ini_validators_ut_check_SOURCES) $(ini_valueobj_ut_SOURCES) \ $(path_utils_ut_SOURCES) $(ref_array_ut_SOURCES) \ $(simplebuffer_ut_SOURCES) am__can_run_installinfo = \ @@ -563,6 +587,27 @@ TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/basicobjects/basicobjects.cfg.doxy.in \ + $(top_srcdir)/basicobjects/basicobjects.pc.in \ + $(top_srcdir)/build/ar-lib $(top_srcdir)/build/compile \ + $(top_srcdir)/build/config.guess \ + $(top_srcdir)/build/config.sub $(top_srcdir)/build/depcomp \ + $(top_srcdir)/build/install-sh $(top_srcdir)/build/ltmain.sh \ + $(top_srcdir)/build/missing $(top_srcdir)/build/test-driver \ + $(top_srcdir)/collection/collection.cfg.doxy.in \ + $(top_srcdir)/collection/collection.pc.in \ + $(top_srcdir)/contrib/ding-libs.spec.in \ + $(top_srcdir)/dhash/dhash.pc.in \ + $(top_srcdir)/ini/ini_config.cfg.doxy.in \ + $(top_srcdir)/ini/ini_config.pc.in \ + $(top_srcdir)/path_utils/path_utils.cfg.doxy.in \ + $(top_srcdir)/path_utils/path_utils.pc.in \ + $(top_srcdir)/refarray/ref_array.cfg.doxy.in \ + $(top_srcdir)/refarray/ref_array.pc.in COPYING COPYING.LESSER \ + README build/ar-lib build/compile build/config.guess \ + build/config.sub build/depcomp build/install-sh \ + build/ltmain.sh build/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -888,7 +933,7 @@ libbasicobjects.la libini_config_la_LDFLAGS = \ - -version-info 6:0:1 \ + -version-info 7:0:2 \ -Wl,--version-script=$(top_srcdir)/ini/libini_config.sym ini_config_ut_SOURCES = ini/ini_config_ut.c @@ -917,6 +962,15 @@ libref_array.la \ $(CHECK_LIBS) +ini_parse_ut_check_SOURCES = ini/ini_parse_ut_check.c +ini_parse_ut_check_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS) +ini_parse_ut_check_LDADD = libini_config.la \ + libref_array.la \ + $(CHECK_LIBS) + +ini_validators_ut_check_SOURCES = ini/ini_validators_ut_check.c +ini_validators_ut_check_CFLAGS = $(AM_CFLAGS) $(CHECK_CFLAGS) +ini_validators_ut_check_LDADD = libini_config.la $(CHECK_LIBS) ini_save_ut_SOURCES = ini/ini_save_ut.c ini_save_ut_LDADD = libini_config.la libcollection.la \ libbasicobjects.la libpath_utils.la libref_array.la @@ -941,7 +995,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -962,8 +1015,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -1216,12 +1269,24 @@ ini_parse_ut$(EXEEXT): $(ini_parse_ut_OBJECTS) $(ini_parse_ut_DEPENDENCIES) $(EXTRA_ini_parse_ut_DEPENDENCIES) @rm -f ini_parse_ut$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ini_parse_ut_OBJECTS) $(ini_parse_ut_LDADD) $(LIBS) +ini/ini_parse_ut_check-ini_parse_ut_check.$(OBJEXT): \ + ini/$(am__dirstamp) ini/$(DEPDIR)/$(am__dirstamp) + +ini_parse_ut_check$(EXEEXT): $(ini_parse_ut_check_OBJECTS) $(ini_parse_ut_check_DEPENDENCIES) $(EXTRA_ini_parse_ut_check_DEPENDENCIES) + @rm -f ini_parse_ut_check$(EXEEXT) + $(AM_V_CCLD)$(ini_parse_ut_check_LINK) $(ini_parse_ut_check_OBJECTS) $(ini_parse_ut_check_LDADD) $(LIBS) ini/ini_save_ut.$(OBJEXT): ini/$(am__dirstamp) \ ini/$(DEPDIR)/$(am__dirstamp) ini_save_ut$(EXEEXT): $(ini_save_ut_OBJECTS) $(ini_save_ut_DEPENDENCIES) $(EXTRA_ini_save_ut_DEPENDENCIES) @rm -f ini_save_ut$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ini_save_ut_OBJECTS) $(ini_save_ut_LDADD) $(LIBS) +ini/ini_validators_ut_check-ini_validators_ut_check.$(OBJEXT): \ + ini/$(am__dirstamp) ini/$(DEPDIR)/$(am__dirstamp) + +ini_validators_ut_check$(EXEEXT): $(ini_validators_ut_check_OBJECTS) $(ini_validators_ut_check_DEPENDENCIES) $(EXTRA_ini_validators_ut_check_DEPENDENCIES) + @rm -f ini_validators_ut_check$(EXEEXT) + $(AM_V_CCLD)$(ini_validators_ut_check_LINK) $(ini_validators_ut_check_OBJECTS) $(ini_validators_ut_check_LDADD) $(LIBS) ini/ini_valueobj_ut.$(OBJEXT): ini/$(am__dirstamp) \ ini/$(DEPDIR)/$(am__dirstamp) @@ -1302,9 +1367,11 @@ @AMDEP_TRUE@@am__include@ @am__quote@ini/$(DEPDIR)/ini_metadata.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ini/$(DEPDIR)/ini_parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ini/$(DEPDIR)/ini_parse_ut.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ini/$(DEPDIR)/ini_parse_ut_check-ini_parse_ut_check.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ini/$(DEPDIR)/ini_print.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ini/$(DEPDIR)/ini_save_ut.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ini/$(DEPDIR)/ini_serialize.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@ini/$(DEPDIR)/ini_validators_ut_check-ini_validators_ut_check.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ini/$(DEPDIR)/ini_valueobj.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@ini/$(DEPDIR)/ini_valueobj_ut.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@path_utils/$(DEPDIR)/path_utils.Plo@am__quote@ @@ -1350,6 +1417,34 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ini_configmod_ut_check_CFLAGS) $(CFLAGS) -c -o ini/ini_configmod_ut_check-ini_configmod_ut_check.obj `if test -f 'ini/ini_configmod_ut_check.c'; then $(CYGPATH_W) 'ini/ini_configmod_ut_check.c'; else $(CYGPATH_W) '$(srcdir)/ini/ini_configmod_ut_check.c'; fi` +ini/ini_parse_ut_check-ini_parse_ut_check.o: ini/ini_parse_ut_check.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ini_parse_ut_check_CFLAGS) $(CFLAGS) -MT ini/ini_parse_ut_check-ini_parse_ut_check.o -MD -MP -MF ini/$(DEPDIR)/ini_parse_ut_check-ini_parse_ut_check.Tpo -c -o ini/ini_parse_ut_check-ini_parse_ut_check.o `test -f 'ini/ini_parse_ut_check.c' || echo '$(srcdir)/'`ini/ini_parse_ut_check.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ini/$(DEPDIR)/ini_parse_ut_check-ini_parse_ut_check.Tpo ini/$(DEPDIR)/ini_parse_ut_check-ini_parse_ut_check.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ini/ini_parse_ut_check.c' object='ini/ini_parse_ut_check-ini_parse_ut_check.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ini_parse_ut_check_CFLAGS) $(CFLAGS) -c -o ini/ini_parse_ut_check-ini_parse_ut_check.o `test -f 'ini/ini_parse_ut_check.c' || echo '$(srcdir)/'`ini/ini_parse_ut_check.c + +ini/ini_parse_ut_check-ini_parse_ut_check.obj: ini/ini_parse_ut_check.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ini_parse_ut_check_CFLAGS) $(CFLAGS) -MT ini/ini_parse_ut_check-ini_parse_ut_check.obj -MD -MP -MF ini/$(DEPDIR)/ini_parse_ut_check-ini_parse_ut_check.Tpo -c -o ini/ini_parse_ut_check-ini_parse_ut_check.obj `if test -f 'ini/ini_parse_ut_check.c'; then $(CYGPATH_W) 'ini/ini_parse_ut_check.c'; else $(CYGPATH_W) '$(srcdir)/ini/ini_parse_ut_check.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ini/$(DEPDIR)/ini_parse_ut_check-ini_parse_ut_check.Tpo ini/$(DEPDIR)/ini_parse_ut_check-ini_parse_ut_check.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ini/ini_parse_ut_check.c' object='ini/ini_parse_ut_check-ini_parse_ut_check.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ini_parse_ut_check_CFLAGS) $(CFLAGS) -c -o ini/ini_parse_ut_check-ini_parse_ut_check.obj `if test -f 'ini/ini_parse_ut_check.c'; then $(CYGPATH_W) 'ini/ini_parse_ut_check.c'; else $(CYGPATH_W) '$(srcdir)/ini/ini_parse_ut_check.c'; fi` + +ini/ini_validators_ut_check-ini_validators_ut_check.o: ini/ini_validators_ut_check.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ini_validators_ut_check_CFLAGS) $(CFLAGS) -MT ini/ini_validators_ut_check-ini_validators_ut_check.o -MD -MP -MF ini/$(DEPDIR)/ini_validators_ut_check-ini_validators_ut_check.Tpo -c -o ini/ini_validators_ut_check-ini_validators_ut_check.o `test -f 'ini/ini_validators_ut_check.c' || echo '$(srcdir)/'`ini/ini_validators_ut_check.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ini/$(DEPDIR)/ini_validators_ut_check-ini_validators_ut_check.Tpo ini/$(DEPDIR)/ini_validators_ut_check-ini_validators_ut_check.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ini/ini_validators_ut_check.c' object='ini/ini_validators_ut_check-ini_validators_ut_check.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ini_validators_ut_check_CFLAGS) $(CFLAGS) -c -o ini/ini_validators_ut_check-ini_validators_ut_check.o `test -f 'ini/ini_validators_ut_check.c' || echo '$(srcdir)/'`ini/ini_validators_ut_check.c + +ini/ini_validators_ut_check-ini_validators_ut_check.obj: ini/ini_validators_ut_check.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ini_validators_ut_check_CFLAGS) $(CFLAGS) -MT ini/ini_validators_ut_check-ini_validators_ut_check.obj -MD -MP -MF ini/$(DEPDIR)/ini_validators_ut_check-ini_validators_ut_check.Tpo -c -o ini/ini_validators_ut_check-ini_validators_ut_check.obj `if test -f 'ini/ini_validators_ut_check.c'; then $(CYGPATH_W) 'ini/ini_validators_ut_check.c'; else $(CYGPATH_W) '$(srcdir)/ini/ini_validators_ut_check.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ini/$(DEPDIR)/ini_validators_ut_check-ini_validators_ut_check.Tpo ini/$(DEPDIR)/ini_validators_ut_check-ini_validators_ut_check.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ini/ini_validators_ut_check.c' object='ini/ini_validators_ut_check-ini_validators_ut_check.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ini_validators_ut_check_CFLAGS) $(CFLAGS) -c -o ini/ini_validators_ut_check-ini_validators_ut_check.obj `if test -f 'ini/ini_validators_ut_check.c'; then $(CYGPATH_W) 'ini/ini_validators_ut_check.c'; else $(CYGPATH_W) '$(srcdir)/ini/ini_validators_ut_check.c'; fi` + path_utils/path_utils_ut-path_utils_ut.o: path_utils/path_utils_ut.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(path_utils_ut_CFLAGS) $(CFLAGS) -MT path_utils/path_utils_ut-path_utils_ut.o -MD -MP -MF path_utils/$(DEPDIR)/path_utils_ut-path_utils_ut.Tpo -c -o path_utils/path_utils_ut-path_utils_ut.o `test -f 'path_utils/path_utils_ut.c' || echo '$(srcdir)/'`path_utils/path_utils_ut.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) path_utils/$(DEPDIR)/path_utils_ut-path_utils_ut.Tpo path_utils/$(DEPDIR)/path_utils_ut-path_utils_ut.Po @@ -1552,7 +1647,7 @@ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ - else \ + elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ @@ -1677,6 +1772,20 @@ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) +ini_parse_ut_check.log: ini_parse_ut_check$(EXEEXT) + @p='ini_parse_ut_check$(EXEEXT)'; \ + b='ini_parse_ut_check'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +ini_validators_ut_check.log: ini_validators_ut_check$(EXEEXT) + @p='ini_validators_ut_check$(EXEEXT)'; \ + b='ini_validators_ut_check'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) dhash_test.log: dhash_test$(EXEEXT) @p='dhash_test$(EXEEXT)'; \ b='dhash_test'; \ @@ -1846,10 +1955,16 @@ $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -1884,16 +1999,17 @@ esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -2104,6 +2220,8 @@ uninstall-dist_includeHEADERS uninstall-dist_pkgconfigDATA \ uninstall-libLTLIBRARIES +.PRECIOUS: Makefile + RPMBUILD ?= $(PWD)/rpmbuild diff -Nru ding-libs-0.5.0/version.m4 ding-libs-0.6.0/version.m4 --- ding-libs-0.5.0/version.m4 2015-06-23 12:12:00.000000000 +0000 +++ ding-libs-0.6.0/version.m4 2016-06-22 10:03:58.000000000 +0000 @@ -1,5 +1,5 @@ # Primary version number -m4_define([VERSION_NUMBER], [0.5.0]) +m4_define([VERSION_NUMBER], [0.6.0]) # If the PRERELEASE_VERSION_NUMBER is set, we'll append # it to the release tag when creating an RPM or SRPM @@ -15,4 +15,4 @@ m4_define([COLLECTION_VERSION_NUMBER], [0.7.0]) m4_define([REF_ARRAY_VERSION_NUMBER], [0.1.5]) m4_define([BASICOBJECTS_VERSION_NUMBER], [0.1.1]) -m4_define([INI_CONFIG_VERSION_NUMBER], [1.2.0]) +m4_define([INI_CONFIG_VERSION_NUMBER], [1.3.0])