X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Ftar.c;h=35121ff28430bcd7f776c67427bf19e7cd0cb62d;hb=6fe55234c95c061eda7d1e13591b4f5d8f057083;hp=bd48d7be1f22cc8334d0764de5bb157b697cc741;hpb=b0765e257cf27e5a1fd78715f1b8bef3e30890a5;p=chaz%2Ftar diff --git a/src/tar.c b/src/tar.c index bd48d7b..35121ff 100644 --- a/src/tar.c +++ b/src/tar.c @@ -41,10 +41,11 @@ #include #include +#include #include #include -#include #include +#include #include #include #include @@ -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;