bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] skip-old-files feature request


From: John Stanley
Subject: [Bug-tar] skip-old-files feature request
Date: Tue, 06 Nov 2012 18:50:48 -0500
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121026 Thunderbird/16.0.2

Hi,
I was wondering if it would be possible in the 'skip-old-files' option warning messages, to have a distinction made between existing files and existing directories, i.e., instead of, e.g., printing:

tar: ./usr/local: skipping existing file

print:

tar: ./usr/local/: skipping existing directory

This would make it much easier to parse existing files and existing directories.  I have been using the following simple patch to handle this in my work:

+++ tar-master-1.26.90.new/src/extract.c        2012-11-06 18:18:28.853013706 -0500
@@ -644,8 +644,12 @@ maybe_recoverable (char *file_name, bool
       switch (old_files_option)
        {
        case SKIP_OLD_FILES:
-         WARNOPT (WARN_EXISTING_FILE,
-                  (0, 0, _("%s: skipping existing file"), file_name));
+         if (current_stat_info.had_trailing_slash)
+           WARNOPT (WARN_EXISTING_FILE,
+                    (0, 0, _("%s/: skipping existing directory"), file_name));
+         else
+           WARNOPT (WARN_EXISTING_FILE,
+                    (0, 0, _("%s: skipping existing file"), file_name));
          return RECOVER_SKIP;
 
        case KEEP_OLD_FILES:

 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]