]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
* NEWS: Mention these fixes.
authorJim Meyering <jim@meyering.net>
Sun, 24 Sep 2006 19:28:25 +0000 (19:28 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 24 Sep 2006 19:28:25 +0000 (19:28 +0000)
* src/copy.c (copy_reg): With --verbose (-v), print
"removed `file_name'" just after unlinking a file.
(copy_internal): Likewise, in three more places.
Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent.

ChangeLog
NEWS
src/copy.c

index 698f7cd7473207883c1d12f31e05543bb6d9de27..d037e92d37520061b38bf32d8ddb272ab34b16a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-09-24  Jim Meyering  <jim@meyering.net>
 
+       * NEWS: Mention these fixes.
+       * src/copy.c (copy_reg): With --verbose (-v), print
+       "removed `file_name'" just after unlinking a file.
+       (copy_internal): Likewise, in three more places.
+       Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent.
        * tests/mv/hard-verbose: New file.  Test for the above fix.
        * tests/mv/Makefile.am (TESTS): Add hard-verbose.
 
diff --git a/NEWS b/NEWS
index 071023651965ed691ed72890a03d8974fd7c4fe9..ab9386804dd1ea0466682b1c872058666dd72994 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,9 @@ GNU coreutils NEWS                                    -*- outline -*-
   cp -i and mv -i occasionally neglected to prompt when the copy or move
   action was bound to fail.  This bug dates back to before fileutils-4.0.
 
+  With --verbose (-v), cp and mv would sometimes generate no output,
+  or neglect to report file removal.
+
 * Major changes in release 6.2 (2006-09-18) [stable candidate]
 
 ** Changes in behavior
index c1f3740496d57fbb8d10fbf12cd2276f54ea53d5..2a85578a607797faff754e73be98ea73bcc6bf07 100644 (file)
@@ -296,6 +296,8 @@ copy_reg (char const *src_name, char const *dst_name,
              return_val = false;
              goto close_src_desc;
            }
+         if (x->verbose)
+           printf (_("removed %s\n"), quote (dst_name));
 
          /* Tell caller that the destination file was unlinked.  */
          *new_dst = true;
@@ -1061,6 +1063,8 @@ copy_internal (char const *src_name, char const *dst_name,
                     doesn't end up removing the source file.  */
                  if (rename_succeeded)
                    *rename_succeeded = true;
+                 if (unlink_src && x->verbose)
+                   printf (_("removed %s\n"), quote (src_name));
                  return true;
                }
              if (unlink_src)
@@ -1240,6 +1244,8 @@ copy_internal (char const *src_name, char const *dst_name,
                  return false;
                }
              new_dst = true;
+             if (x->verbose)
+               printf (_("removed %s\n"), quote (dst_name));
            }
        }
     }
@@ -1344,6 +1350,8 @@ copy_internal (char const *src_name, char const *dst_name,
                  error (0, errno, _("cannot remove %s"), quote (dst_name));
                  goto un_backup;
                }
+             if (x->verbose)
+               printf (_("removed %s\n"), quote (dst_name));
              link_failed = (link (earlier_file, dst_name) != 0);
            }