Explorar el Código

- Add --enable-extra-opts configure option for compiling extra-opts support
- Auto-update po/pot files


git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1973 f882894a-f735-0410-b71e-b25c423dba1c

Thomas Guyot-Sionnest hace 18 años
padre
commit
0d13deb0e4
Se han modificado 9 ficheros con 1125 adiciones y 1030 borrados
  1. 14 0
      configure.in
  2. 5 1
      lib/Makefile.am
  3. 2 2
      lib/parse_ini.c
  4. 14 2
      lib/tests/Makefile.am
  5. 1 1
      lib/tests/test_ini.t
  6. 1 1
      lib/tests/test_opts.t
  7. 291 272
      po/de.po
  8. 263 240
      po/fr.po
  9. 534 511
      po/nagios-plugins.pot

+ 14 - 0
configure.in

@@ -160,6 +160,19 @@ AC_CHECK_LIB(tap, plan_tests,
 	AC_SUBST(EXTRA_TEST)
 	)
 
+dnl INI Parsing
+AC_ARG_ENABLE(extra-opts,
+  AC_HELP_STRING([--enable-extra-opts], 
+		[Enables parsing of plugins ini config files for extra options (default: no)]),
+	[enable_extra_opts=$enableval],
+	[enable_extra_opts=no])
+AM_CONDITIONAL([USE_PARSE_INI],[test "$enable_extra_opts" = "yes"])
+if test "$enable_extra_opts" = "yes" ; then
+	EXTRA_TEST="$EXTRA_TEST test_ini test_opts"
+	AC_SUBST(EXTRA_TEST)
+	AC_DEFINE(NP_EXTRA_OPTS,[1],[Enable INI file parsing.])
+fi
+
 dnl Check for PostgreSQL libraries
 _SAVEDLIBS="$LIBS"
 _SAVEDCPPFLAGS="$CPPFLAGS"
@@ -1621,6 +1634,7 @@ ACX_FEATURE([with],[ipv6])
 ACX_FEATURE([with],[mysql])
 ACX_FEATURE([with],[openssl])
 ACX_FEATURE([with],[gnutls])
+ACX_FEATURE([enable],[extra-opts])
 ACX_FEATURE([with],[perl])
 ACX_FEATURE([enable],[perl-modules])
 ACX_FEATURE([with],[cgiurl])

+ 5 - 1
lib/Makefile.am

@@ -6,7 +6,11 @@ noinst_LIBRARIES = libnagiosplug.a
 
 
 libnagiosplug_a_SOURCES = utils_base.c utils_disk.c utils_tcp.c utils_cmd.c
-EXTRA_DIST = utils_base.h utils_disk.h utils_tcp.h utils_cmd.h
+EXTRA_DIST = utils_base.h utils_disk.h utils_tcp.h utils_cmd.h parse_ini.h extra_opts.h
+
+if USE_PARSE_INI
+libnagiosplug_a_SOURCES += parse_ini.c extra_opts.c
+endif USE_PARSE_INI
 
 INCLUDES = -I$(srcdir) -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
 

+ 2 - 2
lib/parse_ini.c

@@ -34,8 +34,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-/* FIXME: N::P dies if section is not found */
-/* FIXME: N::P dies if config file is not found */
+/* TODO: die like N::P if section is not found */
+/* TODO: die like N::P if config file is not found */
 
 /* np_ini_info contains the result of parsing a "locator" in the format
  * [stanza_name][@config_filename] (check_foo@/etc/foo.ini, for example)

+ 14 - 2
lib/tests/Makefile.am

@@ -7,9 +7,11 @@ check_PROGRAMS = @EXTRA_TEST@
 
 INCLUDES = -I$(top_srcdir)/lib -I$(top_srcdir)/gl -I$(top_srcdir)/intl -I$(top_srcdir)/plugins
 
-EXTRA_PROGRAMS = test_utils test_disk test_tcp test_cmd test_base64
+EXTRA_PROGRAMS = test_utils test_disk test_tcp test_cmd test_base64 test_ini test_opts
 
-EXTRA_DIST = test_utils.t test_disk.t test_tcp.t test_cmd.t test_base64.t
+np_test_scripts = test_base64.t test_cmd.t test_disk.t test_ini.t test_opts.t test_tcp.t test_utils.t
+np_test_files = config-dos.ini config-opts.ini config-tiny.ini plugin.ini plugins.ini
+EXTRA_DIST = $(np_test_scripts) $(np_test_files)
 
 LIBS = @LIBINTL@
 
@@ -38,6 +40,16 @@ test_base64_CFLAGS = -g -I..
 test_base64_LDFLAGS = -L/usr/local/lib -ltap
 test_base64_LDADD = $(top_srcdir)/gl/base64.o 
 
+test_ini_SOURCES = test_ini.c
+test_ini_CFLAGS = -g -I..
+test_ini_LDFLAGS = -L/usr/local/lib -ltap
+test_ini_LDADD = ../utils_base.o ../parse_ini.o
+
+test_opts_SOURCES = test_opts.c
+test_opts_CFLAGS = -g -I..
+test_opts_LDFLAGS = -L/usr/local/lib -ltap
+test_opts_LDADD = ../utils_base.o ../parse_ini.o ../extra_opts.o
+
 test: ${noinst_PROGRAMS}
 	perl -MTest::Harness -e '$$Test::Harness::switches=""; runtests(map {$$_ .= ".t"} @ARGV)' $(EXTRA_PROGRAMS)
 

+ 1 - 1
lib/tests/test_ini.t

@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 use Test::More;
 if (! -e "./test_ini") {
-	plan skip_all => "./test_ini not compiled - please install tap library to test";
+	plan skip_all => "./test_ini not compiled - please install tap library and/or enable parse-ini to test";
 }
 exec "./test_ini";

+ 1 - 1
lib/tests/test_opts.t

@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 use Test::More;
 if (! -e "./test_opts") {
-	plan skip_all => "./test_opts not compiled - please install tap library to test";
+	plan skip_all => "./test_opts not compiled - please install tap library and/or enable parse-ini to test";
 }
 exec "./test_opts";

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 291 - 272
po/de.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 263 - 240
po/fr.po


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 534 - 511
po/nagios-plugins.pot


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio