Fri Jan 3 11:31:42 CET 2003 Stepan Kasal When using --listed-incremental together with --one-file-system with arguments, say, / /usr, the /usr path may be abandoned as it's other fs, and even mentioning it as the second parameter doesn't help. We have to reset the information that that dir has already been processed before we go to the second parameter. * incremen.c (reset_directory): New function. * common.h (reset_directory): Dtto. * names.c (collect_and_sort_names): Be careful that the for loop loops over given names only, kill the hidden recursion; if one-file-system, reset_directory before processing it. diff -urpN tar-1.13.25.orig/src/common.h tar-1.13.25/src/common.h --- tar-1.13.25.orig/src/common.h Fri Sep 21 02:00:55 2001 +++ tar-1.13.25/src/common.h Fri Jan 3 11:28:13 2003 @@ -411,6 +411,7 @@ void delete_archive_members PARAMS ((voi /* Module incremen.c. */ +void reset_directory PARAMS ((char *)); char *get_directory_contents PARAMS ((char *, dev_t)); void read_directory_file PARAMS ((void)); void write_directory_file PARAMS ((void)); diff -urpN tar-1.13.25.orig/src/incremen.c tar-1.13.25/src/incremen.c --- tar-1.13.25.orig/src/incremen.c Wed Aug 29 20:20:19 2001 +++ tar-1.13.25/src/incremen.c Fri Jan 3 11:22:41 2003 @@ -162,6 +162,19 @@ find_directory (char *name) } } +/* The directory NAME has been given on cmdine (or else)---explicitely. + The '-l' option has been given. + It is possible that this is a mount point which has already been killed; + in this case we have to reset the children. */ +void +reset_directory (char *name) +{ + struct directory *directory = find_directory (name); + + if (directory != NULL && directory->children == NO_CHILDREN) + directory->children = CHANGED_CHILDREN; +} + static int compare_dirents (const void *first, const void *second) { diff -urpN tar-1.13.25.orig/src/names.c tar-1.13.25/src/names.c --- tar-1.13.25.orig/src/names.c Wed Aug 29 23:33:54 2001 +++ tar-1.13.25/src/names.c Fri Jan 3 11:26:48 2003 @@ -772,7 +772,7 @@ void collect_and_sort_names (void) { struct name *name; - struct name *next_name; + struct name **saved_tail; int num_names; struct stat statbuf; @@ -784,9 +784,10 @@ collect_and_sort_names (void) if (!namelist) addname (".", 0); - for (name = namelist; name; name = next_name) + for (saved_tail = nametail, name = namelist; + name; + name = (&name->next == saved_tail ? NULL : name->next)) { - next_name = name->next; if (name->found || name->dir_contents) continue; if (name->regexp) /* FIXME: just skip regexps for now */ @@ -805,6 +806,8 @@ collect_and_sort_names (void) } if (S_ISDIR (statbuf.st_mode)) { + if (one_file_system_option) + reset_directory (name->name); name->found = 1; add_hierarchy_to_namelist (name, statbuf.st_dev); }