Package: release.debian.org
Severity: normal
User: release.debian....@packages.debian.org
Usertags: unblock

Please unblock package logtool

logtool hadn't been updated in almost 7 years (upstream hasn't been
active, and the package seemed to still work), but the recent binNMU
that was done to rebuild with PIE triggered an RC bug in the upgrade
path.

The main fix is a rework of the configuration system to fix the
above-mentioned RC bug, but while at it, I refreshed the autotools
build system (which required a few changes to configure.in to make it
work with modern autotools) and bumped the debhelper compat level as
well as the Standards-Version.

wouter@gangtai:~/debian$ debdiff logtool_1.2.8-8.dsc logtool_1.2.8-9.dsc | 
diffstat
 Makefile                          |    1 
 conf/logtool.conf                 |   30 -
 conf/logtool.conf.in              |   30 -
 config.h                          |   96 +++--
 configure.in                      |    6 
 debian/dirs                       |    6 
 debian/preinst                    |   17 
 install-sh                        |  704 +++++++++++++++++++++++++-------------
 logtool-1.2.8/debian/changelog    |   23 +
 logtool-1.2.8/debian/compat       |    2 
 logtool-1.2.8/debian/control      |    2 
 logtool-1.2.8/debian/logtool.dirs |   21 +
 logtool-1.2.8/debian/postinst     |   16 
 logtool-1.2.8/src/Makefile        |   22 -
 src/Makefile.in                   |   19 -
 15 files changed, 665 insertions(+), 330 deletions(-)

full debdiff attached

unblock logtool/1.2.8-9

-- System Information:
Debian Release: 9.0
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unreleased'), (500, 'unstable'), 
(500, 'testing'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, m68k, arm64

Kernel: Linux 4.9.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=nl_BE.UTF-8, LC_CTYPE=nl_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
diff -u logtool-1.2.8/debian/changelog logtool-1.2.8/debian/changelog
--- logtool-1.2.8/debian/changelog
+++ logtool-1.2.8/debian/changelog
@@ -1,3 +1,26 @@
+logtool (1.2.8-9) unstable; urgency=medium
+
+  * The "My previous upload is old enough to read now" upload.
+  * Standards-Version: bump to 3.9.8 (from 3.8.4).
+  * debian/compat: bump to 10
+  * configure.in: update, so it works with newer versions of autotools
+  * rerun autoreconf
+  * debian/dirs: remove, merge with logtool.dirs
+  * conf/logtool.conf.in: move every regex file entry to a .d type
+    directory rather than a plain file
+  * src/Makefile.in: create the sample regex files as
+    /etc/logtool/<file>.d/<file> rather than directly as a plain file
+  * debian/postinst: symlink files into the directories rather than into
+    the old filename
+  * debian/preinst: create, add code to remove symlinks if they exist
+    (relying on postinst to recreate them in their right location)
+  * debian/postinst, debian/preinst: add dpkg-maintscript-helper stuff
+    to move conffiles to their new location
+  * debian/logtool.dirs: add new directories
+  * The above 6 items Closes: #858046.
+
+ -- Wouter Verhelst <wou...@debian.org>  Tue, 28 Mar 2017 17:43:41 +0200
+
 logtool (1.2.8-8) unstable; urgency=low
 
   * New translations:
diff -u logtool-1.2.8/debian/compat logtool-1.2.8/debian/compat
--- logtool-1.2.8/debian/compat
+++ logtool-1.2.8/debian/compat
@@ -1 +1 @@
-7
+10
diff -u logtool-1.2.8/debian/control logtool-1.2.8/debian/control
--- logtool-1.2.8/debian/control
+++ logtool-1.2.8/debian/control
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Wouter Verhelst <wou...@debian.org>
 Build-Depends: debhelper (>> 7.0.50)
-Standards-Version: 3.8.4
+Standards-Version: 3.9.8
 Homepage: http://xjack.org/logtool/
 
 Package: logtool
reverted:
--- logtool-1.2.8/debian/dirs
+++ logtool-1.2.8.orig/debian/dirs
@@ -1,6 +0,0 @@
-usr/bin
-usr/sbin
-usr/share/doc/logtool
-usr/share/man/man1
-usr/share/man/man8
-etc/logtool
diff -u logtool-1.2.8/debian/logtool.dirs logtool-1.2.8/debian/logtool.dirs
--- logtool-1.2.8/debian/logtool.dirs
+++ logtool-1.2.8/debian/logtool.dirs
@@ -1,3 +1,22 @@
+etc/logtool
+etc/logtool/blue.d
+etc/logtool/brightblue.d
+etc/logtool/brightcyan.d
+etc/logtool/brightgreen.d
+etc/logtool/brightmagenta.d
+etc/logtool/brightred.d
+etc/logtool/brightwhite.d
+etc/logtool/brightyellow.d
+etc/logtool/cyan.d
+etc/logtool/exclude.d
+etc/logtool/green.d
+etc/logtool/include.d
+etc/logtool/magenta.d
+etc/logtool/white.d
+etc/logtool/yellow.d
 usr/bin
+usr/sbin
+usr/share/doc/logtool
 usr/share/lintian/overrides
-etc/logtool
+usr/share/man/man1
+usr/share/man/man8
diff -u logtool-1.2.8/debian/postinst logtool-1.2.8/debian/postinst
--- logtool-1.2.8/debian/postinst
+++ logtool-1.2.8/debian/postinst
@@ -2,6 +2,13 @@
 
 . /usr/share/debconf/confmodule
 
+set -e
+
+for file in blue brightblue brightcyan brightgreen brightmagenta brightred 
brightwhite brightyellow cyan exclude green include magenta white yellow
+do
+       dpkg-maintscript-helper mv_conffile /etc/logtool/$file  
/etc/logtool/${file}.d/$file 1.2.8-9~ -- "$@"
+done
+
 db_get logtool/manual
 if [ "$RET" = "false" ]
 then
@@ -11,17 +18,16 @@
                 if [ "$RET" = "true" ]
                 then
                         db_get logtool/map-$level-to-file
-                        file=/etc/logtool/"$RET"
-                        [ -e $file ] || mv $file $file.bak
+                        file=/etc/logtool/"$RET".d/$level
                        case $level in
                                paranoid|server|workstation)
-                                       ln -sbf /etc/logcheck/ignore.d.$level 
$file
+                                       ln -s /etc/logcheck/ignore.d.$level 
$file || true
                                        ;;
                                violations|cracking)
-                                       ln -sbf /etc/logcheck/$level.d $file
+                                       ln -s /etc/logcheck/$level.d $file || 
true
                                        ;;
                                violations-ignore)
-                                       ln -sbf /etc/logcheck/$level.d $file
+                                       ln -s /etc/logcheck/$level.d $file || 
true
                                        ;;
                        esac
                 fi
diff -u logtool-1.2.8/src/Makefile logtool-1.2.8/src/Makefile
--- logtool-1.2.8/src/Makefile
+++ logtool-1.2.8/src/Makefile
@@ -1,4 +1,3 @@
-# Generated automatically from Makefile.in by configure.
 # generated automagicly from Makefile.in - don't edit Makefile directly!!!
 PROG = logtool
 OBJS = readconf.o getopt.o regex.o parser.o ansi.o ascii.o tai64nfrac.o \
@@ -14,7 +13,7 @@
 
 CC = gcc
 INSTALL = /usr/bin/install -c
-CFLAGS= -g -O2 -DHAVE_CONFIG_H
+CFLAGS= -g -O2 -fdebug-prefix-map=/home/wouter/debian/logtool-1.2.8=. 
-fstack-protector-strong -Wformat -Werror=format-security -DHAVE_CONFIG_H
 LDFLAGS = 
 
 ### The main build stuff
@@ -34,22 +33,11 @@
        $(INSTALL) -m 0555 -o root $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG)
        $(INSTALL) -m 0444 -o root ../doc/logtool.1 $(DESTDIR)$(MANDIR)/man1
        # we do each individual file here because install-sh is braindead. :(
-       $(INSTALL) -m 0644 -o root ../conf/blue $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightblue $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightcyan $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightgreen $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightmagenta $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightred $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightwhite $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightyellow $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/cyan $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/exclude $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/green $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/include $(DESTDIR)$(ETCDIR)/
+       for file in blue brightblue brightcyan brightgreen brightmagenta 
brightred brightwhite brightyellow cyan exclude green include magenta white 
yellow; do\
+               $(INSTALL) -m 0755 -o root -d $(DESTDIR)$(ETCDIR)/$${file}.d/; \
+               $(INSTALL) -m 0644 -o root ../conf/$${file} 
$(DESTDIR)$(ETCDIR)/$${file}.d/; \
+       done
        $(INSTALL) -m 0644 -o root ../conf/logtool.conf $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/magenta $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/white $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/yellow $(DESTDIR)$(ETCDIR)/
 
 clean:
        -rm -f a.out core *~ *.o *.a $(PROG) debug
only in patch2:
unchanged:
--- logtool-1.2.8.orig/Makefile
+++ logtool-1.2.8/Makefile
@@ -1,4 +1,3 @@
-# Generated automatically from Makefile.in by configure.
 # This is just a bootstrap Makefile.  The real one's are in the various 
subdir's.
 build_it: src/Makefile
        if [ ! -f ./config.cache ] ; then ./configure ; fi
only in patch2:
unchanged:
--- logtool-1.2.8.orig/conf/logtool.conf
+++ logtool-1.2.8/conf/logtool.conf
@@ -19,28 +19,28 @@
 #
 # valid values for the following are 
[/path/to/some/file/containing/regex_expressions]
 # you probably want to just leave the defaults, and edit the files accordingly
-includefile=/etc/logtool/include       
-excludefile=/etc/logtool/exclude
+includefile=/etc/logtool/include.d
+excludefile=/etc/logtool/exclude.d
 #
-greenfile=/etc/logtool/green
-brightgreenfile=/etc/logtool/brightgreen
+greenfile=/etc/logtool/green.d
+brightgreenfile=/etc/logtool/brightgreen.d
 #
-yellowfile=/etc/logtool/yellow
-brightyellowfile=/etc/logtool/brightyellow
+yellowfile=/etc/logtool/yellow.d
+brightyellowfile=/etc/logtool/brightyellow.d
 #
-bluefile=/etc/logtool/blue
-brightbluefile=/etc/logtool/brightblue
+bluefile=/etc/logtool/blue.d
+brightbluefile=/etc/logtool/brightblue.d
 #
-cyanfile=/etc/logtool/cyan
-brightcyanfile=/etc/logtool/brightcyan
+cyanfile=/etc/logtool/cyan.d
+brightcyanfile=/etc/logtool/brightcyan.d
 #
-magentafile=/etc/logtool/magenta
-brightmagentafile=/etc/logtool/brightmagenta
+magentafile=/etc/logtool/magenta.d
+brightmagentafile=/etc/logtool/brightmagenta.d
 #
-whitefile=/etc/logtool/white
-brightwhitefile=/etc/logtool/brightwhite
+whitefile=/etc/logtool/white.d
+brightwhitefile=/etc/logtool/brightwhite.d
 #
-brightredfile=/etc/logtool/brightred
+brightredfile=/etc/logtool/brightred.d
 #
 #
 # New for 1.2.0 - module config directives
only in patch2:
unchanged:
--- logtool-1.2.8.orig/conf/logtool.conf.in
+++ logtool-1.2.8/conf/logtool.conf.in
@@ -19,28 +19,28 @@
 #
 # valid values for the following are 
[/path/to/some/file/containing/regex_expressions]
 # you probably want to just leave the defaults, and edit the files accordingly
-includefile=@sysconfdir@/include       
-excludefile=@sysconfdir@/exclude
+includefile=@sysconfdir@/include.d
+excludefile=@sysconfdir@/exclude.d
 #
-greenfile=@sysconfdir@/green
-brightgreenfile=@sysconfdir@/brightgreen
+greenfile=@sysconfdir@/green.d
+brightgreenfile=@sysconfdir@/brightgreen.d
 #
-yellowfile=@sysconfdir@/yellow
-brightyellowfile=@sysconfdir@/brightyellow
+yellowfile=@sysconfdir@/yellow.d
+brightyellowfile=@sysconfdir@/brightyellow.d
 #
-bluefile=@sysconfdir@/blue
-brightbluefile=@sysconfdir@/brightblue
+bluefile=@sysconfdir@/blue.d
+brightbluefile=@sysconfdir@/brightblue.d
 #
-cyanfile=@sysconfdir@/cyan
-brightcyanfile=@sysconfdir@/brightcyan
+cyanfile=@sysconfdir@/cyan.d
+brightcyanfile=@sysconfdir@/brightcyan.d
 #
-magentafile=@sysconfdir@/magenta
-brightmagentafile=@sysconfdir@/brightmagenta
+magentafile=@sysconfdir@/magenta.d
+brightmagentafile=@sysconfdir@/brightmagenta.d
 #
-whitefile=@sysconfdir@/white
-brightwhitefile=@sysconfdir@/brightwhite
+whitefile=@sysconfdir@/white.d
+brightwhitefile=@sysconfdir@/brightwhite.d
 #
-brightredfile=@sysconfdir@/brightred
+brightredfile=@sysconfdir@/brightred.d
 #
 #
 # New for 1.2.0 - module config directives
only in patch2:
unchanged:
--- logtool-1.2.8.orig/config.h
+++ logtool-1.2.8/config.h
@@ -1,50 +1,92 @@
-/* config.h.  Generated automatically by configure.  */
-/* config.h.in.  Generated automatically from configure.in by autoheader 2.13. 
 */
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.in by autoheader.  */
 
-/* Define to empty if the keyword does not work.  */
-/* #undef const */
+/* Define to 1 if you have the `gethostbyaddr' function. */
+#define HAVE_GETHOSTBYADDR 1
 
-/* Define to `unsigned' if <sys/types.h> doesn't define.  */
-/* #undef size_t */
+/* Define to 1 if you have the <getopt.h> header file. */
+#define HAVE_GETOPT_H 1
 
-/* Define if you have the ANSI C header files.  */
-#define STDC_HEADERS 1
+/* Define to 1 if you have the `inet_addr' function. */
+#define HAVE_INET_ADDR 1
 
-/* Define if you have the gethostbyaddr function.  */
-#define HAVE_GETHOSTBYADDR 1
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
 
-/* Define if you have the inet_addr function.  */
-#define HAVE_INET_ADDR 1
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
 
-/* Define if you have the regcomp function.  */
+/* Define to 1 if you have the `regcomp' function. */
 #define HAVE_REGCOMP 1
 
-/* Define if you have the regexec function.  */
+/* Define to 1 if you have the `regexec' function. */
 #define HAVE_REGEXEC 1
 
-/* Define if you have the regfree function.  */
-#define HAVE_REGFREE 1
+/* Define to 1 if you have the <regex.h> header file. */
+#define HAVE_REGEX_H 1
 
-/* Define if you have the strncasecmp function.  */
-#define HAVE_STRNCASECMP 1
+/* Define to 1 if you have the `regfree' function. */
+#define HAVE_REGFREE 1
 
-/* Define if we have setenv */
+/* Define to 1 if you have the `setenv' function. */
 #define HAVE_SETENV 1
 
-/* Define if you have the <getopt.h> header file.  */
-#define HAVE_GETOPT_H 1
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
 
-/* Define if you have the <regex.h> header file.  */
-#define HAVE_REGEX_H 1
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
 
-/* Define if you have the <sysexits.h> header file.  */
+/* Define to 1 if you have the `strncasecmp' function. */
+#define HAVE_STRNCASECMP 1
+
+/* Define to 1 if you have the <sysexits.h> header file. */
 #define HAVE_SYSEXITS_H 1
 
-/* Define if you have the <time.h> header file.  */
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <time.h> header file. */
 #define HAVE_TIME_H 1
 
-/* Define if you have the <unistd.h> header file.  */
+/* Define to 1 if you have the <unistd.h> header file. */
 #define HAVE_UNISTD_H 1
 
-/* Define if we disabled the resolver function or not */
+/* Define this if inet_addr cannot be found */
 /* #undef NO_RESOLVER */
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT ""
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME ""
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING ""
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME ""
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION ""
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to empty if `const' does not conform to ANSI C. */
+/* #undef const */
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* #undef size_t */
only in patch2:
unchanged:
--- logtool-1.2.8.orig/configure.in
+++ logtool-1.2.8/configure.in
@@ -1,5 +1,4 @@
-AM_INIT_AUTOMAKE(logtool,1.2.8)
-AM_PROG_CC_STDC
+dnl AC_INIT_AUTOMAKE(logtool,1.2.8)
 
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(src/logtool.c)
@@ -24,6 +23,7 @@
        
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
+AM_PROG_CC_STDC
 
 AC_HEADER_STDC
 
@@ -41,7 +41,7 @@
                 ],
                 [
                         AC_MSG_WARN([Warning: unable to find inet_addr - 
resolver disabled])
-                        AC_DEFINE(NO_RESOLVER)
+                        AC_DEFINE([NO_RESOLVER], 1, [Define this if inet_addr 
cannot be found])
                         NO_RESOLVER="yes"
                 ])
         ])
only in patch2:
unchanged:
--- logtool-1.2.8.orig/debian/preinst
+++ logtool-1.2.8/debian/preinst
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+for file in blue brightblue brightcyan brightgreen brightmagenta brightred 
brightwhite brightyellow cyan exclude green include magenta white yellow
+do
+       if [ -L /etc/logtool/$file ]
+       then
+               # fix for #858046
+               rm /etc/logtool/$file
+               if [ -f /etc/logtool/${file}~ ]
+               then
+                       mv /etc/logtool/${file}~ /etc/logtool/${file}
+               fi
+       fi
+       dpkg-maintscript-helper mv_conffile /etc/logtool/$file 
/etc/logtool/${file}.d/$file 1.2.8-9~ -- "$@"
+done
+
+#DEBHELPER#
only in patch2:
unchanged:
--- logtool-1.2.8.orig/install-sh
+++ logtool-1.2.8/install-sh
@@ -1,250 +1,508 @@
 #!/bin/sh
-#
 # install - install a program, script, or datafile
-# This comes from X11R5 (mit/util/scripts/install.sh).
+
+scriptversion=2014-09-12.12; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
 #
-# Copyright 1991 by the Massachusetts Institute of Technology
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
 #
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation, and that the name of M.I.T. not be used in advertising or
-# publicity pertaining to distribution of the software without specific,
-# written prior permission.  M.I.T. makes no representations about the
-# suitability of this software for any purpose.  It is provided "as is"
-# without express or implied warranty.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
 #
 # Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
 
+tab='  '
+nl='
+'
+IFS=" $tab$nl"
 
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+# Set DOITPROG to "echo" to test this script.
 
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
 
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-transformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
 rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-       -c) instcmd="$cpprog"
-           shift
-           continue;;
-
-       -d) dir_arg=true
-           shift
-           continue;;
-
-       -m) chmodcmd="$chmodprog $2"
-           shift
-           shift
-           continue;;
-
-       -o) chowncmd="$chownprog $2"
-           shift
-           shift
-           continue;;
-
-       -g) chgrpcmd="$chgrpprog $2"
-           shift
-           shift
-           continue;;
-
-       -s) stripcmd="$stripprog"
-           shift
-           continue;;
-
-       -t=*) transformarg=`echo $1 | sed 's/-t=//'`
-           shift
-           continue;;
-
-       -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
-           shift
-           continue;;
-
-       *)  if [ x"$src" = x ]
-           then
-               src=$1
-           else
-               # this colon is to work around a 386BSD /bin/sh bug
-               :
-               dst=$1
-           fi
-           shift
-           continue;;
-    esac
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification 
time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
+
+    -o) chowncmd="$chownprog $2"
+        shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -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) is_target_a_directory=never;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --) shift
+        break;;
+
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
+
+    *)  break;;
+  esac
+  shift
 done
 
-if [ x"$src" = x ]
-then
-       echo "install:  no input file specified"
-       exit 1
-else
-       true
-fi
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
 
-if [ x"$dir_arg" != x ]; then
-       dst=$src
-       src=""
-       
-       if [ -d $dst ]; then
-               instcmd=:
-       else
-               instcmd=mkdir
-       fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad 
-# if $src (and thus $dsttmp) contains '*'.
-
-       if [ -f $src -o -d $src ]
-       then
-               true
-       else
-               echo "install:  $src does not exist"
-               exit 1
-       fi
-       
-       if [ x"$dst" = x ]
-       then
-               echo "install:  no destination specified"
-               exit 1
-       else
-               true
-       fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
-       if [ -d $dst ]
-       then
-               dst="$dst"/`basename $src`
-       else
-               true
-       fi
+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
 
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-#  this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='   
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
-       pathcomp="${pathcomp}${1}"
-       shift
-
-       if [ ! -d "${pathcomp}" ] ;
-        then
-               $mkdirprog "${pathcomp}"
-       else
-               true
-       fi
-
-       pathcomp="${pathcomp}/"
-done
+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.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  done
 fi
 
-if [ x"$dir_arg" != x ]
-then
-       $doit $instcmd $dst &&
-
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
-       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
-       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
-       if [ x"$transformarg" = x ] 
-       then
-               dstfile=`basename $dst`
-       else
-               dstfile=`basename $dst $transformbasename | 
-                       sed $transformarg`$transformbasename
-       fi
-
-# don't allow the sed command to completely eliminate the filename
-
-       if [ x"$dstfile" = x ] 
-       then
-               dstfile=`basename $dst`
-       else
-               true
-       fi
-
-# Make a temp file name in the proper directory.
-
-       dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
-       $doit $instcmd $src $dsttmp &&
-
-       trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing.  If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call 'install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
 
-       if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
-       if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
-       if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
-       if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;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
 
-# Now rename the file to the real destination.
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
 
-       $doit $rmcmd -f $dstdir/$dstfile &&
-       $doit $mvcmd $dsttmp $dstdir/$dstfile 
+for src
+do
+  # Protect names problematic for 'test' and other utilities.
+  case $src in
+    -* | [=\(\)!]) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+    dst=$dst_arg
+
+    # 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 "$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
+      dstdir=`dirname "$dst"`
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  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.
+            ;;
+          *)
+            # $RANDOM is not portable (e.g. dash);  use it when possible to
+            # lower collision chance
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 
2>/dev/null; exit $ret' 0
+
+            # As "mkdir -p" follows symlinks and we work in /tmp possibly;  so
+            # create the $tmpdir first (and fail if unsuccessful) to make sure
+            # that nobody tries to guess the $tmpdir name.
+            if (umask $mkdir_umask &&
+                $mkdirprog $mkdir_mode "$tmpdir" &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/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.
+                   test_tmpdir="$tmpdir/a"
+                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
+    esac
 
-fi &&
+    if
+      $posix_mkdir && (
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      set -f
+      set fnord $dstdir
+      shift
+      set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+        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/
+      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
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # 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` &&
+       set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       set +f &&
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # 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 rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
 
+    trap '' 0
+  fi
+done
 
-exit 0
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
only in patch2:
unchanged:
--- logtool-1.2.8.orig/src/Makefile.in
+++ logtool-1.2.8/src/Makefile.in
@@ -33,22 +33,11 @@
        $(INSTALL) -m 0555 -o root $(PROG) $(DESTDIR)$(PREFIX)/bin/$(PROG)
        $(INSTALL) -m 0444 -o root ../doc/logtool.1 $(DESTDIR)$(MANDIR)/man1
        # we do each individual file here because install-sh is braindead. :(
-       $(INSTALL) -m 0644 -o root ../conf/blue $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightblue $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightcyan $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightgreen $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightmagenta $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightred $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightwhite $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/brightyellow $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/cyan $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/exclude $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/green $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/include $(DESTDIR)$(ETCDIR)/
+       for file in blue brightblue brightcyan brightgreen brightmagenta 
brightred brightwhite brightyellow cyan exclude green include magenta white 
yellow; do\
+               $(INSTALL) -m 0755 -o root -d $(DESTDIR)$(ETCDIR)/$${file}.d/; \
+               $(INSTALL) -m 0644 -o root ../conf/$${file} 
$(DESTDIR)$(ETCDIR)/$${file}.d/; \
+       done
        $(INSTALL) -m 0644 -o root ../conf/logtool.conf $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/magenta $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/white $(DESTDIR)$(ETCDIR)/
-       $(INSTALL) -m 0644 -o root ../conf/yellow $(DESTDIR)$(ETCDIR)/
 
 clean:
        -rm -f a.out core *~ *.o *.a $(PROG) debug

Reply via email to