Hello community, here is the log from the commit of package logwarn for openSUSE:Factory checked in at 2016-05-29 03:13:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/logwarn (Old) and /work/SRC/openSUSE:Factory/.logwarn.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "logwarn" Changes: -------- --- /work/SRC/openSUSE:Factory/logwarn/logwarn.changes 2014-11-24 11:08:26.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.logwarn.new/logwarn.changes 2016-05-29 03:14:32.000000000 +0200 @@ -1,0 +2,16 @@ +Fri May 27 18:18:55 UTC 2016 - [email protected] + +- Update project homepage URL +- Update source file URL + +------------------------------------------------------------------- +Wed May 25 02:17:52 UTC 2016 - [email protected] + +- Upgrade to release 1.0.12 + + Added note to man page that the default behavior is to match + + Fix substitution for @BASH_SHELL@ in check_logwarn script + - Remove temporary fix check-logwarn-bash.patch + + Moved project hosing from Google code to GitHub + + Added `-R' flag (issue #24) + +------------------------------------------------------------------- Old: ---- check-logwarn-bash.patch logwarn-1.0.11.tar.gz New: ---- logwarn-1.0.12.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ logwarn.spec ++++++ --- /var/tmp/diff_new_pack.Vy49jJ/_old 2016-05-29 03:14:33.000000000 +0200 +++ /var/tmp/diff_new_pack.Vy49jJ/_new 2016-05-29 03:14:33.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package logwarn # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (C) 2010-2011 Archie L. Cobbs. All rights reserved. # # All modifications and additions to the file contributed by third parties @@ -18,15 +18,13 @@ Name: logwarn -Version: 1.0.11 +Version: 1.0.12 Release: 0 Summary: Utility for finding interesting messages in log files License: Apache-2.0 Group: System/Monitoring -Source: %{name}-%{version}.tar.gz -# PATCH-FIX-UPSTREAM fix ${BASH} def'n in check_logwarn -Patch1: check-logwarn-bash.patch -Url: http://%{name}.googlecode.com/ +Source: https://s3.amazonaws.com/archie-public/%{name}/%{name}-%{version}.tar.gz +Url: https://github.com/archiecobbs/%{name}/ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: gcc BuildRequires: make @@ -51,10 +49,9 @@ %prep %setup -q -%patch1 %build -%{configure} BASH=/bin/bash +%{configure} make %install ++++++ logwarn-1.0.11.tar.gz -> logwarn-1.0.12.tar.gz ++++++ ++++ 2972 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/CHANGES new/logwarn-1.0.12/CHANGES --- old/logwarn-1.0.11/CHANGES 2014-01-12 20:18:29.000000000 +0100 +++ new/logwarn-1.0.12/CHANGES 2016-05-25 04:04:38.000000000 +0200 @@ -1,4 +1,11 @@ +Version 1.0.12 Released May 24, 2016 + + - Added note to man page that the default behavior is to match + - Fix substitution for @BASH_SHELL@ in check_logwarn script + - Moved project hosing from Google code to GitHub + - Added `-R' flag (issue #24) + Version 1.0.11 (r115) Released January 12, 2014 - Added `-l' flag (contributed by Tobias Galitzien) @@ -65,4 +72,3 @@ - Initial release -$Id: CHANGES 115 2014-01-12 19:18:28Z archie.cobbs $ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/INSTALL new/logwarn-1.0.12/INSTALL --- old/logwarn-1.0.11/INSTALL 2013-05-13 17:16:13.000000000 +0200 +++ new/logwarn-1.0.12/INSTALL 2015-08-25 21:47:46.000000000 +0200 @@ -10,6 +10,4 @@ https://www.google.com/search?q=how+to+build+rpm -See http://code.google.com/p/logwarn for more information about logwarn. - -$Id: INSTALL 110 2013-05-13 15:16:13Z archie.cobbs $ +See https://github.com/archiecobbs/logwarn for more information about logwarn. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/Makefile.am new/logwarn-1.0.12/Makefile.am --- old/logwarn-1.0.11/Makefile.am 2012-11-25 23:26:48.000000000 +0100 +++ new/logwarn-1.0.12/Makefile.am 2016-05-25 04:08:29.000000000 +0200 @@ -15,8 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# $Id: Makefile.am 103 2012-11-25 22:26:48Z archie.cobbs $ -# bin_PROGRAMS= logwarn @@ -26,20 +24,20 @@ docdir= $(datadir)/doc/packages/$(PACKAGE) -doc_DATA= CHANGES COPYING README INSTALL AUTHORS +doc_DATA= CHANGES COPYING README.md INSTALL AUTHORS plugindir= $(prefix)/lib/nagios/plugins plugin_SCRIPTS= check_logwarn -EXTRA_DIST= CHANGES +EXTRA_DIST= CHANGES README.md logwarn_SOURCES= main.c \ state.c \ - svnrev.c + gitrev.c -svnrev.c: - printf 'const char logwarn_svnrev[] = "%s";\n' `svnversion -n` > svnrev.c +gitrev.c: + printf 'const char *const logwarn_version = "%s";\n' "`git describe`" > gitrev.c .PHONY: tests tests: logwarn diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/README new/logwarn-1.0.12/README --- old/logwarn-1.0.11/README 2010-12-30 20:57:06.000000000 +0100 +++ new/logwarn-1.0.12/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,29 +0,0 @@ - -Logwarn - Utility for finding interesting messages in log files - -Logwarn searches for interesting messages in log files, where -``interesting'' is defined by a user-supplied list of positive and -negative extended regular expressions provided on the command line. - -Each log message is compared against each pattern in the order given. If -the log message matches a positive pattern before matching a negative -pattern then it's printed to standard output. - -Logwarn keeps track of its position between invocations, so each matching -line is only ever output once. It also finds messages in log files that -have been rotated (and possibly compressed) since the previous invocation. - -Logwarn also includes support for log messages that span multiple lines. - -Logwarn is written in C for efficient execution. A Nagios plugin is also -included. - -See INSTALL for installation instructions. - -See COPYING for license. - -See CHANGES for change history. - -Enjoy! - -$Id: README 37 2010-12-30 19:57:06Z archie.cobbs $ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/README.md new/logwarn-1.0.12/README.md --- old/logwarn-1.0.11/README.md 1970-01-01 01:00:00.000000000 +0100 +++ new/logwarn-1.0.12/README.md 2015-05-04 20:21:56.000000000 +0200 @@ -0,0 +1,13 @@ +**Logwarn** searches for interesting messages in log files, where ``interesting'' is defined by a user-supplied list of positive and negative extended regular expressions. + +Each log message is compared against each pattern in the order given. If the log message matches a positive pattern before matching a negative pattern then it's printed to standard output. + +**Logwarn** keeps track of its position between invocations, so each matching line is only ever output once. It also finds messages in log files that have been rotated (and possibly compressed) since the previous invocation. + +**Logwarn** also includes support for log messages that span multiple lines. + +**Logwarn** is written in C for efficient execution. + +A [Nagios](http://www.nagios.org/) plugin is also included: see the [NagiosPlugin](https://github.com/archiecobbs/logwarn/wiki/NagiosPlugin) wiki page for more info. + +You can view the [ManPage](https://github.com/archiecobbs/logwarn/wiki/ManPage) online. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/check_logwarn.in new/logwarn-1.0.12/check_logwarn.in --- old/logwarn-1.0.11/check_logwarn.in 2012-11-22 00:21:51.000000000 +0100 +++ new/logwarn-1.0.12/check_logwarn.in 2015-05-04 20:21:56.000000000 +0200 @@ -1,4 +1,4 @@ -#!@BASH@ +#!@BASH_SHELL@ # Constants NAME="check_logwarn" @@ -10,6 +10,7 @@ prefix="@prefix@" exec_prefix="@exec_prefix@" LOGWARN="@bindir@/logwarn" +BASH_SHELL="@BASH_SHELL@" CAT="@CAT@" SED="@SED@" RM="@RM@" @@ -78,7 +79,7 @@ # Filter output? if [ -n "${FILTER_COMMAND}" ]; then - "${BASH}" -c "${FILTER_COMMAND}" < "${STDOUT_FILE}" > "${STDERR_FILE}" 2>&1 + "${BASH_SHELL}" -c "${FILTER_COMMAND}" < "${STDOUT_FILE}" > "${STDERR_FILE}" 2>&1 FILTER_RESULT="$?" if [ "${FILTER_RESULT}" -ne 0 ]; then echo -n "UNKNOWN: \`-F' command failed: " diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/configure.ac new/logwarn-1.0.12/configure.ac --- old/logwarn-1.0.11/configure.ac 2012-11-25 23:36:31.000000000 +0100 +++ new/logwarn-1.0.12/configure.ac 2015-08-25 21:47:56.000000000 +0200 @@ -15,15 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# $Id$ -# -AC_INIT([logwarn Utility for finding interesting messages in log files], [1.0.11], [http://code.google.com/p/logwarn/], [logwarn]) +AC_INIT([logwarn Utility for finding interesting messages in log files], [1.0.12], [https://github.com/archiecobbs/logwarn/], [logwarn]) AC_CONFIG_AUX_DIR(scripts) AM_INIT_AUTOMAKE dnl AM_MAINTAINER_MODE AC_PREREQ(2.59) -AC_REVISION($Id$) AC_PREFIX_DEFAULT(/usr) AC_PROG_MAKE_SET @@ -41,8 +38,8 @@ # Check for required programs AC_PROG_INSTALL AC_PROG_CC -AC_PATH_PROG([BASH], [bash], [], []) -if test "x${BASH}" = "x"; then +AC_PATH_PROG([BASH_SHELL], [bash], [], []) +if test "x${BASH_SHELL}" = "x"; then AC_MSG_ERROR[bash not found] fi AC_PATH_PROG([CAT], [cat], [], []) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/gitrev.c new/logwarn-1.0.12/gitrev.c --- old/logwarn-1.0.11/gitrev.c 1970-01-01 01:00:00.000000000 +0100 +++ new/logwarn-1.0.12/gitrev.c 2016-05-25 04:15:51.000000000 +0200 @@ -0,0 +1 @@ +const char *const logwarn_version = "1.0.12"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/logwarn.1.in new/logwarn-1.0.12/logwarn.1.in --- old/logwarn-1.0.11/logwarn.1.in 2013-12-30 16:43:06.000000000 +0100 +++ new/logwarn-1.0.12/logwarn.1.in 2015-08-25 21:48:15.000000000 +0200 @@ -16,8 +16,6 @@ .\" See the License for the specific language governing permissions and .\" limitations under the License. .\" -.\" $Id$ -.\" .Dd January 31, 2011 .Dt LOGWARN 1 .Os @@ -27,7 +25,7 @@ .Sh SYNOPSIS .Nm logwarn .Bk -words -.Op Fl achlnpqvz +.Op Fl achlnpqRvz .Op Fl d Ar dir | Fl f Ar file .Op Fl m Ar firstpat .Op Fl r Ar sufpat @@ -49,6 +47,10 @@ searches for interesting messages in log files, where ``interesting'' is defined by an user-supplied list of positive and negative extended regular expressions provided on the command line. +A line that matches neither a positive nor a negative pattern is considered a match +(use the +.Fl p +flag to change this default). .Pp Each log message is compared against each .Ar pattern @@ -69,7 +71,7 @@ flags below). By default, .Nm -interprets a missing state file as if the file were previously empty, +interprets a missing state file as if the log file were previously empty, resulting in a scan of its entire contents; this behavior can be changed with the .Fl a and @@ -82,7 +84,9 @@ .Ar logfile followed by a suffix matching the rotated log file suffix pattern (see the .Fl r -flag below). +and +.Fl R +flags below). .Pp By default, each line in the log file is considered to be a separate log message. Log messages spanning multiple lines are supported with the use of the @@ -254,11 +258,16 @@ detects that a log file has been rotated, it searches for the rotated log file by finding files in the same directory that have the same name as .Ar logfile -plus a suffix matching the rotated log file suffix pattern -(when multiple files match, the first one in sorting order is chosen). +plus a suffix matching the rotated log file suffix pattern. .Pp The default rotated log file suffix pattern is -.Pa ^(-[[:digit:]]{8}|\e\.[01])(\e\.(gz|bz2))?$ +.Pa ^(-[[:digit:]]{8}|\e\.[01])(\e\.(gz|xz|bz2))?$ +.It Fl R +When multiple files match the rotated log file suffix pattern, +norally the first one in sorting order is chosen. +When this flag is given, the last one is chosen instead. +.Pp +This option is appropriate when the suffix is formatted as a timestamp. .It Fl v Output version information and exit. .It Fl z @@ -283,13 +292,15 @@ flag to reinitialize the saved state. .Pp Currently, the supported compression types for rotated files are -.Xr gzip 1 +.Xr gzip 1 , +.Xr bzip2 1 , and -.Xr bzip2 1 . +.Xr xz 1 . The corresponding executables -.Xr gunzip 1 +.Xr gunzip 1 , +.Xr bunzip2 1 , and -.Xr bunzip2 1 +.Xr unxz 1 must be present on the user's .Pa $PATH . .Pp @@ -349,7 +360,7 @@ .Sh SEE ALSO .Rs .%T "Logwarn: Utility for finding interesting messages in log files" -.%O http://logwarn.googlecode.com/ +.%O https://github.com/archiecobbs/logwarn .Re .Sh AUTHOR -.An Archie L. Cobbs Aq [email protected] +.An Archie L. Cobbs Aq [email protected] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/logwarn.h new/logwarn-1.0.12/logwarn.h --- old/logwarn-1.0.11/logwarn.h 2011-11-18 22:02:07.000000000 +0100 +++ new/logwarn-1.0.12/logwarn.h 2015-08-25 21:47:43.000000000 +0200 @@ -15,8 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * - * $Id: logwarn.h 81 2011-11-18 21:02:07Z archie.cobbs $ */ // Maximum line length @@ -36,7 +34,7 @@ #define EXIT_ERROR 2 // Global variables -extern const char logwarn_svnrev[]; +extern const char *const logwarn_version; // Global functions extern int load_state(const char *state_file, struct scan_state *state); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/logwarn.spec.in new/logwarn-1.0.12/logwarn.spec.in --- old/logwarn-1.0.11/logwarn.spec.in 2013-05-13 17:16:13.000000000 +0200 +++ new/logwarn-1.0.12/logwarn.spec.in 2015-08-25 21:47:53.000000000 +0200 @@ -15,8 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# $Id: logwarn.spec.in 110 2013-05-13 15:16:13Z archie.cobbs $ -# Name: logwarn Version: @PACKAGE_VERSION@ @@ -25,7 +23,7 @@ Summary: Utility for finding interesting messages in log files Group: System/Monitoring Source: %{name}-%{version}.tar.gz -URL: http://%{name}.googlecode.com/ +URL: https://github.com/archiecobbs/%{name} BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: make BuildRequires: gcc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/main.c new/logwarn-1.0.12/main.c --- old/logwarn-1.0.11/main.c 2013-12-30 19:13:49.000000000 +0100 +++ new/logwarn-1.0.12/main.c 2015-08-25 21:48:08.000000000 +0200 @@ -15,8 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * - * $Id: main.c 114 2013-12-30 18:13:46Z archie.cobbs $ */ #include "config.h" @@ -61,6 +59,7 @@ static int auto_initialize; static int num_match_patterns; static int read_from_beginning; +static int match_last_rotated; static int quiet; static int any_matches; static int line_numbers; @@ -92,7 +91,7 @@ int i; // Parse command line - while ((i = getopt(argc, argv, "acd:f:hilL:m:M:N:npqr:tvz")) != -1) { + while ((i = getopt(argc, argv, "acd:f:hilL:m:M:N:npqRr:tvz")) != -1) { switch (i) { case 'a': auto_initialize = 1; @@ -136,6 +135,9 @@ case 'r': rotpat = optarg; break; + case 'R': + match_last_rotated = 1; + break; case 'h': usage(); exit(EXIT_OK); @@ -286,6 +288,8 @@ struct dirent *ent; for (ent = readdir(dir); ent != NULL; ent = readdir(dir)) { + int prefer; + int diff; // Rotated file must have logfile name as prefix if (strncmp(ent->d_name, bname, bnamelen) != 0) @@ -299,8 +303,14 @@ if (regexec(&rot_pattern.regex, ent->d_name + bnamelen, 0, NULL, 0) != 0) continue; - // It's a candidate. Pick the first one in sorting order. - if (rotated == NULL || strcmp(ent->d_name, rotated) < 0) { + // It's a candidate. Pick the first (or last) one in sorting order. + if (rotated == NULL) + prefer = 1; + else { + diff = strcmp(ent->d_name, rotated); + prefer = match_last_rotated ? diff > 0 : diff < 0; + } + if (prefer) { if ((rotated = realloc(rotated, strlen(ent->d_name) + 1)) == NULL) { fprintf(stderr, "%s: %s: %s\n", PACKAGE, "realloc", strerror(errno)); exit(EXIT_ERROR); @@ -562,7 +572,7 @@ static void version(void) { - fprintf(stderr, "%s version %s (r%s)\n", PACKAGE_TARNAME, PACKAGE_VERSION, logwarn_svnrev); + fprintf(stderr, "%s version %s (%s)\n", PACKAGE, VERSION, logwarn_version); fprintf(stderr, "Copyright (C) 2010-2013 Archie L. Cobbs\n"); fprintf(stderr, "This is free software; see the source for copying conditions. There is NO\n"); fprintf(stderr, "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/scripts/missing new/logwarn-1.0.12/scripts/missing --- old/logwarn-1.0.11/scripts/missing 2014-01-12 20:18:48.000000000 +0100 +++ new/logwarn-1.0.12/scripts/missing 2016-05-25 04:15:46.000000000 +0200 @@ -1,10 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-01-06.18; # UTC +scriptversion=2012-06-26.16; # UTC -# Copyright (C) 1996-2012 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard <[email protected]>, 1996. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard <[email protected]>, 1996. # 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 @@ -29,61 +29,33 @@ exit 1 fi -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, 'missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi +case $1 in -msg="missing on your system" + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file 'aclocal.m4' - autoconf touch file 'configure' - autoheader touch file 'config.h.in' - autom4te touch the output file, or create a stub one - automake touch all 'Makefile.in' files - bison create 'y.tab.[ch]', if possible, from existing .[ch] - flex create 'lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create 'lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create 'y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. @@ -98,228 +70,141 @@ ;; -*) - echo 1>&2 "$0: Unknown '$1' option" + echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; +# Run the given program, remember its exit status. +"$@"; st=$? - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running '$TOOL --version' or '$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified 'acinclude.m4' or '${configure_ac}'. You might want - to install the Automake and Perl packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified '${configure_ac}'. You might want to install the - Autoconf and GNU m4 packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified 'acconfig.h' or '${configure_ac}'. You might want - to install the Autoconf and GNU m4 packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; +# If it succeeded, we are done. +test $st -eq 0 && exit 0 - automake*) - echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'. - You might want to install the Automake and Perl packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: '$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get '$1' as part of Autoconf from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: '$1' $msg. You should only need it if - you modified a '.y' file. You may need the Bison package - in order for those modifications to take effect. You can get - Bison from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified a '.l' file. You may need the Flex package - in order for those modifications to take effect. You can get - Flex from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - Help2man package in order for those modifications to take - effect. You can get Help2man from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: '$1' is $msg. You should only need it if - you modified a '.texi' or '.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy 'make' (AIX, - DU, IRIX). You might want to install the Texinfo package or - the GNU make package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: '$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the 'README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing '$1' program." - exit 1 - ;; -esac +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi -exit 0 +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'automa4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/state.c new/logwarn-1.0.12/state.c --- old/logwarn-1.0.11/state.c 2011-11-18 22:25:52.000000000 +0100 +++ new/logwarn-1.0.12/state.c 2015-08-25 21:48:06.000000000 +0200 @@ -15,8 +15,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * - * $Id: state.c 83 2011-11-18 21:25:52Z archie.cobbs $ */ #include "config.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/logwarn-1.0.11/svnrev.c new/logwarn-1.0.12/svnrev.c --- old/logwarn-1.0.11/svnrev.c 2014-01-12 20:18:56.000000000 +0100 +++ new/logwarn-1.0.12/svnrev.c 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -const char logwarn_svnrev[] = "115";
