Sergey Poznyakoff wrote:

> > nope, that tries to backup everything now (i.e. i have / as one of the
> > file systems and it began traversing into file systems not listed on
> > the command line)
> 
> When in incremental mode tar must traverse into file systems not listed
> on the command line, it is normal.

I managed to reproduce the situation you were talking about. Indeed, tar
was traversing too far under the mount points, whereas normally it should
see only the mount point itself. Here is an updated patch for version
1.15.1. Please inform me if it works for you.

Regards,
Sergey

diff -pur tar-1.15.1/src/common.h tar-1.15.1-n/src/common.h
--- tar-1.15.1/src/common.h     2004-12-21 16:31:58.000000000 +0200
+++ tar-1.15.1-n/src/common.h   2005-12-13 13:02:30.000000000 +0200
@@ -315,6 +315,7 @@ struct name
     uintmax_t found_count;     /* number of times a matching file has
                                   been found */
     int isdir;
+    int explicit;               /* was explicitely given in the command line */
     char firstch;              /* first char is literally matched */
     char regexp;               /* this name is a regexp, not literal */
     int change_dir;            /* set with the -C option */
diff -pur tar-1.15.1/src/incremen.c tar-1.15.1-n/src/incremen.c
--- tar-1.15.1/src/incremen.c   2004-09-06 14:30:42.000000000 +0300
+++ tar-1.15.1-n/src/incremen.c 2005-12-13 13:03:26.000000000 +0200
@@ -174,6 +174,7 @@ scan_directory (struct obstack *stk, cha
 
            if (S_ISDIR (stat_data.st_mode))
              {
+               struct name *np;
                bool nfs = NFS_FILE_STAT (stat_data);
 
                if ((directory = find_directory (name_buffer)) != NULL)
@@ -216,7 +217,8 @@ scan_directory (struct obstack *stk, cha
                       : CHANGED_CHILDREN);
                  }
 
-               if (one_file_system_option && device != stat_data.st_dev)
+               if (one_file_system_option && device != stat_data.st_dev
+                    && !((np = name_scan (name_buffer) && np->explicit))) 
                  directory->children = NO_CHILDREN;
                else if (children == ALL_CHILDREN)
                  directory->children = ALL_CHILDREN;
diff -pur tar-1.15.1/src/names.c tar-1.15.1-n/src/names.c
--- tar-1.15.1/src/names.c      2004-09-06 14:30:54.000000000 +0300
+++ tar-1.15.1-n/src/names.c    2005-12-13 13:02:30.000000000 +0200
@@ -209,6 +209,7 @@ name_add (const char *name)
     }
   name_array[names++] = name;
 }
+
 
 /* Names from external name file.  */
 
@@ -506,7 +507,8 @@ addname (char const *string, int change_
   name->firstch = 1;           /* assume first char is literal */
   name->change_dir = change_dir;
   name->dir_contents = 0;
-
+  name->explicit = 1;
+  
   if (string && is_pattern (string))
     {
       name->regexp = 1;
@@ -784,6 +786,8 @@ add_hierarchy_to_namelist (struct name *
          string_length = strlen (string);
          if (*string == 'D')
            {
+             struct name *np;
+             
              if (allocated_length <= name_length + string_length)
                {
                  do
@@ -797,8 +801,9 @@ add_hierarchy_to_namelist (struct name *
                  namebuf = xrealloc (namebuf, allocated_length + 1);
                }
              strcpy (namebuf + name_length, string + 1);
-             add_hierarchy_to_namelist (addname (namebuf, change_dir),
-                                        device);
+             np = addname (namebuf, change_dir);
+             np->explicit = 0;
+             add_hierarchy_to_namelist (np, device);
            }
        }
 



_______________________________________________
Bug-tar mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-tar

Reply via email to