bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] [Fwd: Bug#424692: --remove-files complains that directorie


From: Sergey Poznyakoff
Subject: Re: [Bug-tar] [Fwd: Bug#424692: --remove-files complains that directories "changed as we read it"]
Date: Fri, 18 May 2007 11:22:34 +0300

Bdale Garbee <address@hidden> ha escrit:

> The attached from a user of my Debian tar packaging.  I have no personal
> experience with the --remove-files option, but the behavior described
> certainly isn't what I would have expected.

Thank you.  I have installed the following patch:

2007-05-18  Sergey Poznyakoff  <address@hidden>

        * src/create.c (dump_file0): Original ctime cannot be used as a
        directory change indicator if --remove-files is given.

Index: src/create.c
===================================================================
RCS file: /cvsroot/tar/tar/src/create.c,v
retrieving revision 1.124
diff -p -u -r1.124 create.c
--- src/create.c        23 Jan 2007 10:25:06 -0000      1.124
+++ src/create.c        18 May 2007 08:19:09 -0000
@@ -1195,7 +1195,6 @@ dump_dir0 (char *directory,
 
            /* Now output all the files in the directory.  */
            /* FIXME: Should speed this up by cd-ing into the dir.  */
-
            for (entry = directory; (entry_len = strlen (entry)) != 0;
                 entry += entry_len + 1)
              {
@@ -1646,7 +1645,10 @@ dump_file0 (struct tar_stat_info *st, co
 
       if (ok)
        {
-         if (timespec_cmp (get_stat_ctime (&final_stat), original_ctime) != 0
+         if ((timespec_cmp (get_stat_ctime (&final_stat), original_ctime) != 0
+              /* Original ctime will change if the file is a directory and
+                 --remove-files is given */
+              && !(remove_files_option && is_dir))
              || original_size < final_stat.st_size)
            {
              WARN ((0, 0, _("%s: file changed as we read it"),
        

Regards,
Sergey
        




reply via email to

[Prev in Thread] Current Thread [Next in Thread]