]> Dogcows Code - chaz/tar/blobdiff - src/create.c
Relicense under GPLv3
[chaz/tar] / src / create.c
index 4ff30542ba8fb27e0d7c268ce09c0f8163165f40..a9cf981df748827ae5033bf813db1d9f81eb691b 100644 (file)
@@ -7,7 +7,7 @@
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 2, or (at your option) any later
+   Free Software Foundation; either version 3, or (at your option) any later
    version.
 
    This program is distributed in the hope that it will be useful, but
@@ -711,10 +711,10 @@ write_extended (bool global, struct tar_stat_info *st, union block *old_header)
   char *p;
   int type;
 
-  if (extended_header.buffer || extended_header.stk == NULL)
+  if (st->xhdr.buffer || st->xhdr.stk == NULL)
     return old_header;
 
-  xheader_finish (&extended_header);
+  xheader_finish (&st->xhdr);
   memcpy (hp.buffer, old_header, sizeof (hp));
   if (global)
     {
@@ -726,7 +726,7 @@ write_extended (bool global, struct tar_stat_info *st, union block *old_header)
       type = XHDTYPE;
       p = xheader_xhdr_name (st);
     }
-  xheader_write (type, p, &extended_header);
+  xheader_write (type, p, &st->xhdr);
   free (p);
   header = find_next_block ();
   memcpy (header, &hp.buffer, sizeof (hp.buffer));
@@ -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)
              {
@@ -1270,7 +1269,7 @@ create_archive (void)
   const char *p;
 
   open_archive (ACCESS_WRITE);
-  xheader_write_global ();
+  buffer_write_global_xheader ();
 
   if (incremental_option)
     {
@@ -1646,7 +1645,10 @@ dump_file0 (struct tar_stat_info *st, const char *p,
 
       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"),
This page took 0.023536 seconds and 4 git commands to generate.