]> Dogcows Code - chaz/tar/blobdiff - src/tar.c
(dump_dir0): Implement --exclude-tag option
[chaz/tar] / src / tar.c
index bd48d7be1f22cc8334d0764de5bb157b697cc741..35121ff28430bcd7f776c67427bf19e7cd0cb62d 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
 
 #include <argmatch.h>
 #include <closeout.h>
+#include <configmake.h>
 #include <exitfail.h>
 #include <getdate.h>
-#include <localedir.h>
 #include <rmt.h>
+#include <rmt-command.h>
 #include <prepargs.h>
 #include <quotearg.h>
 #include <version-etc.h>
@@ -254,6 +255,7 @@ enum
   DELETE_OPTION,
   EXCLUDE_CACHES_OPTION,
   EXCLUDE_OPTION,
+  EXCLUDE_TAG_OPTION,
   FORCE_LOCAL_OPTION,
   GROUP_OPTION,
   HANG_OPTION,
@@ -603,6 +605,8 @@ static struct argp_option options[] = {
    N_("exclude patterns listed in FILE"), GRID+1 },
   {"exclude-caches", EXCLUDE_CACHES_OPTION, 0, 0,
    N_("exclude directories containing a cache tag"), GRID+1 },
+  {"exclude-tag", EXCLUDE_TAG_OPTION, N_("FILE"), 0,
+   N_("exclude directories containing FILE"), GRID+1 }, 
   {"no-recursion", NO_RECURSION_OPTION, 0, 0,
    N_("avoid descending automatically in directories"), GRID+1 },
   {"one-file-system", ONE_FILE_SYSTEM_OPTION, 0, 0,
@@ -980,7 +984,7 @@ read_name_from_file (FILE *fp, struct obstack *stk)
 
   if (counter == 0 && c != EOF)
     return file_list_skip;
-  
+
   obstack_1grow (stk, 0);
 
   return (counter == 0 && c == EOF) ? file_list_end : file_list_success;
@@ -1068,7 +1072,7 @@ update_argv (const char *filename, struct argp_state *state)
        case file_list_success:
          count++;
          break;
-         
+
        case file_list_end: /* won't happen, just to pacify gcc */
          break;
 
@@ -1093,7 +1097,7 @@ update_argv (const char *filename, struct argp_state *state)
            filename_terminator = 0;
            break;
          }
-         
+
        case file_list_skip:
          break;
        }
@@ -1506,6 +1510,10 @@ parse_opt (int key, char *arg, struct argp_state *state)
       exclude_caches_option = true;
       break;
 
+    case EXCLUDE_TAG_OPTION:
+      add_exclude_tag (arg);
+      break;
+      
     case FORCE_LOCAL_OPTION:
       force_local_option = true;
       break;
@@ -2346,7 +2354,7 @@ main (int argc, char **argv)
 
   if (stdlis == stdout)
     close_stdout ();
-  else if (ferror (stderr) || fclose (stderr) != 0) 
+  else if (ferror (stderr) || fclose (stderr) != 0)
     exit_status = TAREXIT_FAILURE;
 
   return exit_status;
This page took 0.027973 seconds and 4 git commands to generate.