From 392d7eb5fae3c029fbdeef2bd79ab96db18e72a3 Mon Sep 17 00:00:00 2001 From: Klaus Kaempf Date: Sat, 20 Feb 2010 08:32:43 +0000 Subject: add ChangeLog add --version to wsman to print version and build timestamp --- ChangeLog | 4 ++++ configure.in | 6 ++++-- src/Makefile.am | 3 ++- src/wsman.c | 10 ++++++++-- 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 ChangeLog diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..c06e0d0 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,4 @@ +Version 2.2.3 + Bugfix release, synchronize version with openwsman + - fix double free error on enumeration (Chris Poblete) + - add '--version' to print version and build timestamp \ No newline at end of file diff --git a/configure.in b/configure.in index e68aeae..d3e4784 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(wsmancli, 2.1.0) +AC_INIT(wsmancli, 2.2.3) AC_CONFIG_SRCDIR(wsmancli.spec.in) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AM_CONFIG_HEADER(config.h) @@ -14,8 +14,10 @@ AC_HEADER_STDC WSMAN_PKG=$PACKAGE_NAME AC_SUBST(WSMAN_PKG) +PACKAGE_BUILDTS=`date +%Y%m%d%H%M` +AC_SUBST(PACKAGE_BUILDTS) -PKG_CHECK_MODULES(OPENWSMAN, [openwsman >= 2.1.0]) +PKG_CHECK_MODULES(OPENWSMAN, [openwsman >= 2.2.0]) have_cunit=no AC_CHECK_HEADERS([CUnit/Basic.h], have_cunit="yes" ) AM_CONDITIONAL(BUILD_CUNIT_TESTS, test "$have_cunit" == "yes") diff --git a/src/Makefile.am b/src/Makefile.am index c34591c..370e8e7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,8 @@ AM_CFLAGS = @CFLAGS@ CFLAGS = \ - $(OPENWSMAN_CFLAGS) + $(OPENWSMAN_CFLAGS) \ + -DPACKAGE_BUILDTS=\"$(PACKAGE_BUILDTS)\" wsman_LDADD = \ $(OPENWSMAN_LIBS) \ diff --git a/src/wsman.c b/src/wsman.c index effd19e..0ab6a17 100644 --- a/src/wsman.c +++ b/src/wsman.c @@ -179,8 +179,11 @@ static char wsman_parse_options(int argc, char **argv) { char retval = 0; u_error_t *error = NULL; + char my_version = 0; u_option_entry_t options[] = { + {"version", 'q', U_OPTION_ARG_NONE, &my_version, + "Display application version", NULL}, {"debug", 'd', U_OPTION_ARG_INT, &debug_level, "Set the verbosity of debugging output.", "1-6"}, {"encoding", 'j', U_OPTION_ARG_STRING, &encoding, @@ -366,6 +369,11 @@ static char wsman_parse_options(int argc, char **argv) return FALSE; } + if (my_version) { + fprintf(stdout, PACKAGE_STRING " (" PACKAGE_BUILDTS ")\n\n"); + exit(0); + } + if (argc > 2) { _action = argv[1]; resource_uri_opt = argv[2]; @@ -837,7 +845,6 @@ int main(int argc, char **argv) enumContext = wsmc_get_enum_context(enum_response); ws_xml_destroy_doc(enum_response); } else { - u_free(enumContext); break; } @@ -852,7 +859,6 @@ int main(int argc, char **argv) if (wsmc_get_response_code(cl) != 200 && wsmc_get_response_code(cl) != 400 && wsmc_get_response_code(cl) != 500) { - u_free(enumContext); break; } u_free(enumContext); -- cgit