colorls csh missing doublequotes + fixed localization of verbose stdout

outputs
This commit is contained in:
Ondrej Vasik 2008-03-04 12:04:31 +00:00
parent d3c0f6f098
commit fec3583011
3 changed files with 55 additions and 11 deletions

View File

@ -21,7 +21,7 @@ index df6792d..e3a0d50 100644
@item -x
@itemx --exact
diff --git a/src/install.c b/src/install.c
index db08751..95e37fc 100644
index db08751..6925c55 100644
--- a/src/install.c
+++ b/src/install.c
@@ -1,5 +1,5 @@
@ -31,17 +31,37 @@ index db08751..95e37fc 100644
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
@@ -762,7 +762,7 @@ announce_mkdir (char const *dir, void *options)
@@ -160,6 +160,19 @@ static struct option const long_options[] =
{NULL, 0, NULL, 0}
};
+/* 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);
+}
+
static void
cp_option_init (struct cp_options *x)
{
@@ -762,7 +775,7 @@ announce_mkdir (char const *dir, void *options)
{
struct cp_options const *x = options;
if (x->verbose)
- error (0, 0, _("creating directory %s"), quote (dir));
+ printf (_("%s: creating directory %s\n"), program_name, quote (dir));
+ verbose_output (stdout,_("creating directory %s"), quote (dir));
}
/* Make ancestor directory DIR, whose last file name component is
diff --git a/src/rmdir.c b/src/rmdir.c
index bb1a0c8..609c387 100644
index bb1a0c8..1f17f6a 100644
--- a/src/rmdir.c
+++ b/src/rmdir.c
@@ -1,6 +1,6 @@
@ -52,21 +72,41 @@ index bb1a0c8..609c387 100644
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
@@ -134,7 +134,7 @@ remove_parents (char *dir)
@@ -72,6 +72,19 @@ static struct option const longopts[] =
{NULL, 0, NULL, 0}
};
+/* 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);
+}
+
/* Return true if ERROR_NUMBER is one of the values associated
with a failed rmdir due to non-empty target directory. */
static bool
@@ -134,7 +147,7 @@ remove_parents (char *dir)
/* Give a diagnostic for each attempted removal if --verbose. */
if (verbose)
- error (0, 0, _("removing directory, %s"), quote (dir));
+ printf(_("%s: removing directory, %s\n"), program_name, quote (dir));
+ verbose_output (stdout,_("removing directory, %s"), quote (dir));
ok = (rmdir (dir) == 0);
@@ -233,7 +233,7 @@ main (int argc, char **argv)
@@ -233,7 +246,7 @@ main (int argc, char **argv)
/* Give a diagnostic for each attempted removal if --verbose. */
if (verbose)
- error (0, 0, _("removing directory, %s"), dir);
+ printf(_("%s: removing directory, %s\n"), program_name, dir);
+ verbose_output(stdout, _("removing directory, %s"), dir);
if (rmdir (dir) != 0)
{

View File

@ -1,7 +1,7 @@
#! /bin/csh -f
# color-ls initialization
if ( $?LS_COLORS ) then
if ( $LS_COLORS != "" ) then
if ( "$LS_COLORS" != "" ) then
#do not override user specified LS_COLORS and use them
goto finish
endif

View File

@ -1,7 +1,7 @@
Summary: The GNU core utilities: a set of tools commonly used in shell scripts
Name: coreutils
Version: 6.10
Release: 9%{?dist}
Release: 10%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -18,7 +18,7 @@ Source202: coreutils-su-l.pamd
Source203: coreutils-runuser-l.pamd
# From upstream
Patch1:coreutils-6.10-verbose.patch
Patch1: coreutils-6.10-verbose.patch
# Our patches
Patch100: coreutils-chgrp.patch
@ -293,6 +293,10 @@ fi
/sbin/runuser
%changelog
* Tue Mar 4 2008 Ondrej Vasik <ovasik@redhat.com> - 6.10-10
- colorls.csh missing doublequotes (#435789)
- fixed possibility to localize verbose outputs
* Mon Mar 3 2008 Ondrej Vasik <ovasik@redhat.com> - 6.10-9
- consolidation of verbose output to stdout (upstream)