+2008-02-03 Guillem Jover <guillem@debian.org>
+
+ * libcompat/Makefile.am (libcompat_a_SOURCES): Remove closeout.c,
+ closeout.h, error.h, long-options.c and long-options.h.
+ * libcompat/closeout.c: Remove unused file.
+ * libcompat/closeout.h: Likewise.
+ * libcompat/error.h: Likewise.
+ * libcompat/long-options.c: Likewise.
+ * libcompat/long-options.h: Likewise.
+
2008-02-03 Raphael Hertzog <hertzog@debian.org>
* scripts/dpkg-shlibdeps.pl: Handle better the case when the
noinst_LIBRARIES = libcompat.a
libcompat_a_SOURCES = \
- closeout.c closeout.h \
- error.h \
getopt.c getopt.h \
getopt1.c \
- long-options.c long-options.h \
obstack.c obstack.h
+++ /dev/null
-/* closeout.c - close standard output
- Copyright (C) 1998 Free Software Foundation, Inc.
-
- 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
- the Free Software Foundation; either version 2, 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
-#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
-
-#include <stdio.h>
-#include "closeout.h"
-#include "error.h"
-
-/* Close standard output, exiting with status STATUS on failure. */
-void
-close_stdout_status (int status)
-{
- if (ferror (stdout))
- error (status, 0, _("write error"));
- if (fclose (stdout) != 0)
- error (status, errno, _("write error"));
-}
-
-/* Close standard output, exiting with status EXIT_FAILURE on failure. */
-void
-close_stdout (void)
-{
- close_stdout_status (EXIT_FAILURE);
-}
+++ /dev/null
-#ifndef PARAMS
-# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
-void close_stdout PARAMS ((void));
-void close_stdout_status PARAMS ((int status));
+++ /dev/null
-/* Declaration for error-reporting function
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
-
- NOTE: The canonical source of this file is maintained with the GNU C
- Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
- 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 the
- Free Software Foundation; either version 2, 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
- USA. */
-
-#ifndef _ERROR_H
-#define _ERROR_H 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined (__STDC__) && __STDC__
-
-/* Print a message with `fprintf (stderr, FORMAT, ...)';
- if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
- If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
-
-extern void error (int status, int errnum, const char *format, ...);
-
-extern void error_at_line (int status, int errnum, const char *fname,
- unsigned int lineno, const char *format, ...);
-
-/* If NULL, error will flush stdout, then print on stderr the program
- name, a colon and a space. Otherwise, error will call this
- function without parameters instead. */
-extern void (*error_print_progname) (void);
-
-#else
-void error ();
-void error_at_line ();
-extern void (*error_print_progname) ();
-#endif
-
-/* This variable is incremented each time `error' is called. */
-extern unsigned int error_message_count;
-
-/* Sometimes we want to have at most one error per line. This
- variable controls whether this mode is selected or not. */
-extern int error_one_per_line;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* error.h */
+++ /dev/null
-/* Utility to accept --help and --version options as unobtrusively as possible.
- Copyright (C) 1993, 1994, 1998 Free Software Foundation, Inc.
-
- 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
- the Free Software Foundation; either version 2, 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* Written by Jim Meyering. */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include "closeout.h"
-#include "long-options.h"
-
-static struct option const long_options[] =
-{
- {"help", no_argument, 0, 'h'},
- {"version", no_argument, 0, 'v'},
- {0, 0, 0, 0}
-};
-
-/* Process long options --help and --version, but only if argc == 2.
- Be careful not to gobble up `--'. */
-
-void
-parse_long_options (argc, argv, command_name, package, version, usage)
- int argc;
- char **argv;
- const char *command_name;
- const char *package;
- const char *version;
- void (*usage)(int);
-{
- int c;
- int saved_opterr;
-
- saved_opterr = opterr;
-
- /* Don't print an error message for unrecognized options. */
- opterr = 0;
-
- if (argc == 2
- && (c = getopt_long (argc, argv, "+", long_options, NULL)) != -1)
- {
- switch (c)
- {
- case 'h':
- (*usage) (0);
-
- case 'v':
- printf ("%s (%s) %s\n", command_name, package, version);
- close_stdout (); /* FIXME: output failure exit status
- should be settable via an arg. */
- exit (0);
-
- default:
- /* Don't process any other long-named options. */
- break;
- }
- }
-
- /* Restore previous value. */
- opterr = saved_opterr;
-
- /* Reset this to zero so that getopt internals get initialized from
- the probably-new parameters when/if getopt is called later. */
- optind = 0;
-}
+++ /dev/null
-/* long-options.h -- declaration for --help- and --version-handling function.
- Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
-
- 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
- the Free Software Foundation; either version 2, 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* Written by Jim Meyering. */
-
-#ifndef PARAMS
-# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
-# define PARAMS(Args) Args
-# else
-# define PARAMS(Args) ()
-# endif
-#endif
-
-void
- parse_long_options PARAMS ((int _argc, char **_argv,
- const char *_command_name,
- const char *_package,
- const char *_version, void (*_usage) (int)));