Bläddra i källkod

Include print-copyr.h, not copysym.h.
(decode_options): Use print_copyright, not copyright_symbol.
(OVERWRITE_DIR_OPTION): New constant.
(long_options, usage, decode_options): Add --overwrite-dir.

Paul Eggert 24 år sedan
förälder
incheckning
5a5f4d06e7
1 ändrade filer med 9 tillägg och 4 borttagningar
  1. 9 4
      src/tar.c

+ 9 - 4
src/tar.c

@@ -36,7 +36,7 @@
 #define GLOBAL
 #define GLOBAL
 #include "common.h"
 #include "common.h"
 
 
-#include <copysym.h>
+#include <print-copyr.h>
 #include <localedir.h>
 #include <localedir.h>
 #include <prepargs.h>
 #include <prepargs.h>
 #include <quotearg.h>
 #include <quotearg.h>
@@ -140,6 +140,7 @@ enum
   NO_WILDCARDS_MATCH_SLASH_OPTION,
   NO_WILDCARDS_MATCH_SLASH_OPTION,
   NULL_OPTION,
   NULL_OPTION,
   OVERWRITE_OPTION,
   OVERWRITE_OPTION,
+  OVERWRITE_DIR_OPTION,
   OWNER_OPTION,
   OWNER_OPTION,
   POSIX_OPTION,
   POSIX_OPTION,
   PRESERVE_OPTION,
   PRESERVE_OPTION,
@@ -236,6 +237,7 @@ static struct option long_options[] =
   {"old-archive", no_argument, 0, 'o'},
   {"old-archive", no_argument, 0, 'o'},
   {"one-file-system", no_argument, 0, 'l'},
   {"one-file-system", no_argument, 0, 'l'},
   {"overwrite", no_argument, 0, OVERWRITE_OPTION},
   {"overwrite", no_argument, 0, OVERWRITE_OPTION},
+  {"overwrite-dir", no_argument, 0, OVERWRITE_DIR_OPTION},
   {"owner", required_argument, 0, OWNER_OPTION},
   {"owner", required_argument, 0, OWNER_OPTION},
   {"portability", no_argument, 0, 'o'},
   {"portability", no_argument, 0, 'o'},
   {"posix", no_argument, 0, POSIX_OPTION},
   {"posix", no_argument, 0, POSIX_OPTION},
@@ -323,6 +325,7 @@ Operation modifiers:\n\
       --remove-files         remove files after adding them to the archive\n\
       --remove-files         remove files after adding them to the archive\n\
   -k, --keep-old-files       don't replace existing files when extracting\n\
   -k, --keep-old-files       don't replace existing files when extracting\n\
       --overwrite            overwrite existing files when extracting\n\
       --overwrite            overwrite existing files when extracting\n\
+      --overwrite-dir        overwrite directory metadata when extracting\n\
   -U, --unlink-first         remove each file prior to extracting over it\n\
   -U, --unlink-first         remove each file prior to extracting over it\n\
       --recursive-unlink     empty hierarchies prior to extracting directory\n\
       --recursive-unlink     empty hierarchies prior to extracting directory\n\
   -S, --sparse               handle sparse files efficiently\n\
   -S, --sparse               handle sparse files efficiently\n\
@@ -960,6 +963,10 @@ decode_options (int argc, char **argv)
 	old_files_option = OVERWRITE_OLD_FILES;
 	old_files_option = OVERWRITE_OLD_FILES;
 	break;
 	break;
 
 
+      case OVERWRITE_DIR_OPTION:
+	old_files_option = OVERWRITE_OLD_DIRS;
+	break;
+
       case OWNER_OPTION:
       case OWNER_OPTION:
 	if (! (strlen (optarg) < UNAME_FIELD_SIZE
 	if (! (strlen (optarg) < UNAME_FIELD_SIZE
 	       && uname_to_uid (optarg, &owner_option)))
 	       && uname_to_uid (optarg, &owner_option)))
@@ -1123,10 +1130,8 @@ decode_options (int argc, char **argv)
 
 
   if (show_version)
   if (show_version)
     {
     {
-      char buf[MB_LEN_MAX + 1];
       printf ("tar (GNU %s) %s\n", PACKAGE, VERSION);
       printf ("tar (GNU %s) %s\n", PACKAGE, VERSION);
-      printf ("Copyright %s 2001 Free Software Foundation, Inc.\n",
-	      copyright_symbol (buf, sizeof buf));
+      print_copyright ("2001 Free Software Foundation, Inc.");
       puts (_("\
       puts (_("\
 This program comes with NO WARRANTY, to the extent permitted by law.\n\
 This program comes with NO WARRANTY, to the extent permitted by law.\n\
 You may redistribute it under the terms of the GNU General Public License;\n\
 You may redistribute it under the terms of the GNU General Public License;\n\