** Consistency
- mkdir and split now write --verbose output to stdout, not stderr.
+ install, mkdir, rmdir and split now write --verbose output to stdout,
+ not to stderr.
* Noteworthy changes in release 6.10 (2008-01-22) [stable]
@itemx --verbose
@opindex -v
@opindex --verbose
-Display status updates as sterilization proceeds.
+Display to standard error all status updates as sterilization proceeds.
@item -x
@itemx --exact
fs.h \
group-list.h \
ls.h \
+ prog-fprintf.h \
remove.h \
system.h \
wheel-size.h \
# to install before applying any user-specified name transformations.
transform = s/ginstall/install/; @program_transform_name@
-ginstall_SOURCES = install.c $(copy_sources)
+ginstall_SOURCES = install.c prog-fprintf.c $(copy_sources)
# This is for the '[' program. Automake transliterates '[' to '_'.
__SOURCES = lbracket.c
mv_SOURCES = mv.c remove.c $(copy_sources)
rm_SOURCES = rm.c remove.c
+mkdir_SOURCES = mkdir.c prog-fprintf.c
+rmdir_SOURCES = rmdir.c prog-fprintf.c
+
uname_SOURCES = uname.c uname-uname.c
arch_SOURCES = uname.c uname-arch.c
/* install - copy files and set attributes
- Copyright (C) 89, 90, 91, 1995-2007 Free Software Foundation, Inc.
+ Copyright (C) 89, 90, 91, 1995-2008 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
#include "mkancesdirs.h"
#include "mkdir-p.h"
#include "modechange.h"
+#include "prog-fprintf.h"
#include "quote.h"
#include "quotearg.h"
#include "savewd.h"
{
struct cp_options const *x = options;
if (x->verbose)
- error (0, 0, _("creating directory %s"), quote (dir));
+ prog_fprintf (stdout, _("creating directory %s"), quote (dir));
}
/* Make ancestor directory DIR, whose last file name component is
#include "lchmod.h"
#include "mkdir-p.h"
#include "modechange.h"
+#include "prog-fprintf.h"
#include "quote.h"
#include "savewd.h"
exit (status);
}
-/* Verbose formatted output of variable count of arguments. */
-static void
-verbose_output (FILE *fp, char const *fmt, ...)
-{
- va_list ap;
- fputs (program_name, fp);
- fputs (": ", fp);
- va_start (ap, fmt);
- vfprintf (fp, fmt, ap);
- va_end (ap);
- fputc ('\n', fp);
-}
-
/* Options passed to subsidiary functions. */
struct mkdir_options
{
{
struct mkdir_options const *o = options;
if (o->created_directory_format)
- verbose_output (stdout, o->created_directory_format, quote (dir));
+ prog_fprintf (stdout, o->created_directory_format, quote (dir));
}
/* Make ancestor directory DIR, whose last component is COMPONENT,
--- /dev/null
+/* prog-fprintf.c - common formating output functions and definitions
+ Copyright (C) 2008 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 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+#include <stdarg.h>
+#include <sys/types.h>
+
+#include "prog-fprintf.h"
+
+extern char *program_name;
+
+/* Display program name followed by variable list.
+ Used for e.g. verbose output */
+void
+prog_fprintf (FILE *fp, char const *fmt, ...)
+{
+ va_list ap;
+ fputs (program_name, fp);
+ fputs (": ", fp);
+ va_start (ap, fmt);
+ vfprintf (fp, fmt, ap);
+ va_end (ap);
+ fputc ('\n', fp);
+}
--- /dev/null
+/* prog-fprintf.h - common formating output functions and definitions
+ Copyright (C) 2008 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 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef PROG_FPRINTF_H
+# define PROG_FPRINTF_H
+
+# include <stdio.h>
+
+extern void prog_fprintf (FILE *fp, char const *fmt, ...);
+
+#endif
/* rmdir -- remove directories
- Copyright (C) 90, 91, 1995-2002, 2004, 2005, 2006, 2007 Free Software
+ Copyright (C) 90, 91, 1995-2002, 2004-2008 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
#include "system.h"
#include "error.h"
+#include "prog-fprintf.h"
#include "quote.h"
/* The official name of this program (e.g., no `g' prefix). */
/* Give a diagnostic for each attempted removal if --verbose. */
if (verbose)
- error (0, 0, _("removing directory, %s"), quote (dir));
+ prog_fprintf (stdout, _("removing directory, %s"), quote (dir));
ok = (rmdir (dir) == 0);
/* Give a diagnostic for each attempted removal if --verbose. */
if (verbose)
- error (0, 0, _("removing directory, %s"), dir);
+ prog_fprintf (stdout, _("removing directory, %s"), quote (dir));
if (rmdir (dir) != 0)
{