[med-svn] [libgtextutils] 37/83: Added 'exit-manip', bumped to version 0.4 (-rc)

Charles Plessy plessy at moszumanska.debian.org
Wed Jan 8 13:37:27 UTC 2014


This is an automated email from the git hooks/post-receive script.

plessy pushed a commit to branch debian/unstable
in repository libgtextutils.

commit 0ef4498568192d001c94d95b42556ad9d50ef2d5
Author: A. Gordon <gordon at cshl.edu>
Date:   Fri May 22 05:10:20 2009 -0400

    Added 'exit-manip', bumped to version 0.4 (-rc)
---
 Makefile.am                                  |   2 +-
 aclocal.m4                                   | 113 +++++++++++++++------------
 configure.ac                                 |   4 +-
 gtextutils-0.3.pc.in                         |   4 +-
 gtextutils-0.3.pc.in => gtextutils-0.4.pc.in |   4 +-
 src/gtextutils/Makefile.am                   |  10 ++-
 src/gtextutils/exit_manip.h                  |  74 ++++++++++++++++++
 7 files changed, 149 insertions(+), 62 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 6b05503..8203e60 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,4 +12,4 @@ EXTRA_DIST = reconf configure
 SUBDIRS = m4 src doc tests
 
 pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = gtextutils-0.3.pc
+pkgconfig_DATA = gtextutils-$(VERSION).pc
diff --git a/aclocal.m4 b/aclocal.m4
index ca9e852..6060ade 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.10.2 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 # 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
@@ -13,8 +13,8 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(AC_AUTOCONF_VERSION, [2.61],,
-[m4_warning([this file was generated for autoconf 2.61.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
@@ -394,7 +394,7 @@ AC_DEFUN(LF_SET_WARNINGS,[
   fi
 ])
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -409,7 +409,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.10'
 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.10.1], [],
+m4_if([$1], [1.10.2], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -423,12 +423,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # AM_SET_CURRENT_AUTOMAKE_VERSION
 # -------------------------------
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
-# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10.1])dnl
+[AM_AUTOMAKE_VERSION([1.10.2])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
@@ -678,57 +678,68 @@ _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
 # 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.
 
-#serial 3
+#serial 5
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[for mf in $CONFIG_FILES; do
-  # Strip MF so we end up with the name of the file.
-  mf=`echo "$mf" | sed -e 's/:.*$//'`
-  # Check whether this is an Automake generated Makefile or not.
-  # We used to match only the files named `Makefile.in', but
-  # some people rename them; so instead we look at the file content.
-  # Grep'ing the first line is not enough: some people post-process
-  # each Makefile.in and add a new line on top of each file to say so.
-  # Grep'ing the whole file is not good either: AIX grep has a line
-  # limit of 2048, but all sed's we know have understand at least 4000.
-  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-    dirpart=`AS_DIRNAME("$mf")`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`AS_DIRNAME(["$file"])`
-    AS_MKDIR_P([$dirpart/$fdir])
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
 
@@ -1034,13 +1045,13 @@ esac
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2005, 2008  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.
 
-# serial 3
+# serial 4
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -1057,7 +1068,7 @@ AC_DEFUN([_AM_SET_OPTION],
 # ----------------------------------
 # OPTIONS is a space-separated list of Automake options.
 AC_DEFUN([_AM_SET_OPTIONS],
-[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
 # -------------------------------------------
diff --git a/configure.ac b/configure.ac
index 67803bd..27980bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 AC_INIT([Gordon-Text_utils-Library],
-        [0.3],
+        [0.4],
         [A. Gordon gordon at cshl.edu],
         [libgtextutils])
 AC_CONFIG_AUX_DIR(config)
@@ -79,7 +79,7 @@ AC_CONFIG_FILES([
    m4/Makefile
    src/Makefile
    src/gtextutils/Makefile
-   gtextutils-0.3.pc
+   gtextutils-0.4.pc
    tests/Makefile
 ])
 
diff --git a/gtextutils-0.3.pc.in b/gtextutils-0.3.pc.in
index eceed2b..53b2ce6 100644
--- a/gtextutils-0.3.pc.in
+++ b/gtextutils-0.3.pc.in
@@ -6,5 +6,5 @@ includedir=@includedir@
 Name: gtextutils
 Description: Gordon's text-utility classes
 Version: @VERSION@
-Libs: -L${libdir} -lgtextutils-0.2
-Cflags: -I${includedir}/gtextutils-0.2
+Libs: -L${libdir} -lgtextutils-0.3
+Cflags: -I${includedir}/gtextutils-0.3
diff --git a/gtextutils-0.3.pc.in b/gtextutils-0.4.pc.in
similarity index 65%
copy from gtextutils-0.3.pc.in
copy to gtextutils-0.4.pc.in
index eceed2b..73d81e6 100644
--- a/gtextutils-0.3.pc.in
+++ b/gtextutils-0.4.pc.in
@@ -6,5 +6,5 @@ includedir=@includedir@
 Name: gtextutils
 Description: Gordon's text-utility classes
 Version: @VERSION@
-Libs: -L${libdir} -lgtextutils-0.2
-Cflags: -I${includedir}/gtextutils-0.2
+Libs: -L${libdir} -lgtextutils- at VERSION@
+Cflags: -I${includedir}/gtextutils- at VERSION@
diff --git a/src/gtextutils/Makefile.am b/src/gtextutils/Makefile.am
index f2e674d..60a98a3 100644
--- a/src/gtextutils/Makefile.am
+++ b/src/gtextutils/Makefile.am
@@ -9,21 +9,22 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 
-lib_LIBRARIES = libgtextutils-0.3.a
+lib_LIBRARIES = libgtextutils-0.4.a
 
-libgtextutils_0_3_a_SOURCES = stream_wrapper.cpp stream_wrapper.h \
+libgtextutils_0_4_a_SOURCES = stream_wrapper.cpp stream_wrapper.h \
 		          text_line_reader.cpp text_line_reader.h \
 			  container_join.h \
 			  natsort.h \
 			  strnatcmp.c strnatcmp.h \
 			  outbuf3.hpp \
 			  tuple_parser.h \
+			  exit_manip.h \
 			  inbuf1.hpp \
 			  pipe_fitter.c pipe_fitter.h
 
-libgtextutils_0_3_a_includedir = $(includedir)/gtextutils-$(VERSION)/gtextutils
+libgtextutils_0_4_a_includedir = $(includedir)/gtextutils-$(VERSION)/gtextutils
 
-libgtextutils_0_3_a_include_HEADERS = container_join.h \
+libgtextutils_0_4_a_include_HEADERS = container_join.h \
 		  text_line_reader.h \
 		  stream_wrapper.h \
 		  natsort.h \
@@ -31,4 +32,5 @@ libgtextutils_0_3_a_include_HEADERS = container_join.h \
 		  outbuf3.hpp \
 		  inbuf1.hpp \
 		  tuple_parser.h \
+		  exit_manip.h \
 		  pipe_fitter.h
diff --git a/src/gtextutils/exit_manip.h b/src/gtextutils/exit_manip.h
new file mode 100644
index 0000000..26cc295
--- /dev/null
+++ b/src/gtextutils/exit_manip.h
@@ -0,0 +1,74 @@
+/*
+   Gordon's Text-Utilities Library
+   Copyright (C) 2009 Assaf Gordon (gordon at cshl.edu)
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Affero General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program 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 Affero General Public License for more details.
+
+   You should have received a copy of the GNU Affero General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+#ifndef __EXIT_MANIP__
+#define __EXIT_MANIP__
+
+/* 
+ Easily terminates a program while printing an error message.
+   
+ Tries to be an STL spirited version of errx(3)
+ 
+ Usage:
+
+	// from where ever in the code you wish to print message and terminate:
+	// will print message to STDERR and exit with exit code 1
+	cerr << "Error: something failed. " << exit_program(1);
+
+	// if you want file+list information, use:
+	cerr << "Error: something failed. " << exit_program_with_source(1);
+
+ */
+
+struct exit_process_struct
+{
+	int exitcode;
+	bool show_source;
+	const char* source_file;
+	size_t      source_file_line_number ;
+} ; 
+
+#define exit_program_with_source(exitcode) exit_program((exitcode),__FILE__,__LINE__)
+inline exit_process_struct exit_program(int exitcode, const char* filename = NULL, const size_t line = 0 )
+{
+	exit_process_struct eps;
+	eps.exitcode = exitcode ;
+	if ( filename == NULL || line == 0 )
+		eps.show_source = false ;
+	else {
+		eps.show_source = true ;
+		eps.source_file = filename ;
+		eps.source_file_line_number = line ;
+	}
+	return eps;
+}
+
+inline std::ostream& operator<< ( std::ostream& strm, const exit_process_struct& eps )
+{
+	if (eps.show_source)
+		strm << " [ " 
+		     << eps.source_file
+		     << " : " << eps.source_file_line_number << " ]";
+
+	strm << std::endl;
+	exit(eps.exitcode);
+	
+	return strm ;
+}
+
+
+#endif

-- 
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/libgtextutils.git



More information about the debian-med-commit mailing list