]> git.cworth.org Git - tar/commitdiff
Merge branch 'dfsg-orig' into dfsg-debian
authorBdale Garbee <bdale@gag.com>
Wed, 25 Feb 2009 06:14:55 +0000 (23:14 -0700)
committerBdale Garbee <bdale@gag.com>
Wed, 25 Feb 2009 06:14:55 +0000 (23:14 -0700)
Conflicts:
cleanup-script.sh
tests/incremental.at

1  2 
cleanup-script.sh
src/create.c
src/list.c
tests/incremental.at

diff --combined cleanup-script.sh
index 39fd20beb1112cb87de9235d64b88648cc525827,684ac91414a1f273819612c8463876f4d1fde32f..1fd7d47b90cd3d6bff24d4285dcf9f9af25e2c14
@@@ -4,6 -4,7 +4,7 @@@
  #     Copyright 2009 by Bdale Garbee.  GPL v2 or any later version.
  #
  
+ git rm -rf doc
  rm -rf doc
  
  # This is a shell archive (produced by GNU sharutils 4.6.3).
@@@ -217,4 -218,7 +218,10 @@@ then ${echo} 'x - removed lock director
  else ${echo} 'x - failed to remove lock directory `'${lock_dir}\''.'
    exit 1
  fi
++<<<<<<< HEAD:cleanup-script.sh
++=======
+ git add doc/Makefile doc/Makefile.in doc/README
++>>>>>>> c286dbf484dc985fb63d5c677fc8cd91b5b1d0f6:cleanup-script.sh
  exit 0
diff --combined src/create.c
index 61bf47a5ce063ab64beb7c5c2d92841e27288b43,a925160e1be90c5b5b0cab7cc301a3ec3e7135fc..fde7ed171f9d40c64806ffee725c5f053ccafc15
@@@ -744,7 -744,7 +744,7 @@@ write_header_name (struct tar_stat_inf
        return write_short_name (st);
      }
    else if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT)
 -         < strlen (st->file_name))
 +         <= strlen (st->file_name))
      return write_long_name (st);
    else
      return write_short_name (st);
@@@ -1041,7 -1041,7 +1041,7 @@@ dump_regular_file (int fd, struct tar_s
    while (size_left > 0)
      {
        size_t bufsize, count;
+       
        mv_size_left (size_left);
  
        blk = find_next_block ();
@@@ -1398,7 -1398,7 +1398,7 @@@ dump_hard_link (struct tar_stat_info *s
          block_ordinal = current_block_ordinal ();
          assign_string (&st->link_name, link_name);
          if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT)
 -            < strlen (link_name))
 +            <= strlen (link_name))
            write_long_link (st);
  
          st->stat.st_size = 0;
@@@ -1495,7 -1495,7 +1495,7 @@@ dump_file0 (struct tar_stat_info *st, c
    assign_string (&st->file_name,
                   safer_name_suffix (p, false, absolute_names_option));
  
-   transform_name (&st->file_name);
+   transform_name (&st->file_name, XFORM_REGFILE);
  
    if (deref_stat (dereference_option, p, &st->stat) != 0)
      {
        }
        buffer[size] = '\0';
        assign_string (&st->link_name, buffer);
-       transform_name (&st->link_name);
+       transform_name (&st->link_name, XFORM_SYMLINK);
        if (NAME_FIELD_SIZE - (archive_format == OLDGNU_FORMAT) < size)
        write_long_link (st);
  
diff --combined src/list.c
index 93de630d7d27e76558656f257e549dfcc7809c16,98c1e396b3547cb22a5ac590bb24d03b03a9b521..c6501722ff4c0d8cbff54ee1db8b62daaf61729c
@@@ -136,14 -136,6 +136,14 @@@ read_and (void (*do_something) (void)
  
          if (!ignore_zeros_option)
            {
 +
 +            /* 
 +             * According to POSIX tar specs, this is wrong, but on the web
 +             * there are some tar specs that can trigger this, and some tar
 +             * implementations create tars according to that spec.  For now,
 +             * let's not be pedantic about issuing the warning.
 +             */
 +#if 0        
              char buf[UINTMAX_STRSIZE_BOUND];
  
              status = read_header (false);
                break;
              WARN ((0, 0, _("A lone zero block at %s"),
                     STRINGIFY_BIGINT (current_block_ordinal (), buf)));
 +#endif
              break;
            }
          status = prev_status;
@@@ -481,11 -472,11 +481,11 @@@ read_header (bool raw_extended_headers
  static char *
  decode_xform (char *file_name, void *data)
  {
-   xform_type type = *(xform_type*)data;
+   int type = *(int*)data;
  
    switch (type)
      {
-     case xform_symlink:
+     case XFORM_SYMLINK:
        /* FIXME: It is not quite clear how and to which extent are the symbolic
         links subject to filename transformation.  In the absence of another
         solution, symbolic links are exempt from component stripping and
         proper. */ 
        return file_name;
        
-     case xform_link:
+     case XFORM_LINK:
        file_name = safer_name_suffix (file_name, true, absolute_names_option);
        break;
        
-     case xform_regfile:
+     case XFORM_REGFILE:
        file_name = safer_name_suffix (file_name, false, absolute_names_option);
        break;
      }
  }
  
  bool
- transform_member_name (char **pinput, xform_type type)
+ transform_member_name (char **pinput, int type)
  {
-   return transform_name_fp (pinput, decode_xform, &type);
+   return transform_name_fp (pinput, type, decode_xform, &type);
  }
  
  #define ISOCTAL(c) ((c)>='0'&&(c)<='7')
@@@ -637,7 -628,16 +637,16 @@@ decode_header (union block *header, str
        stat_info->is_dumpdir = true;
      }
  
-   transform_member_name (&stat_info->file_name, xform_regfile);
+   transform_member_name (&stat_info->file_name, XFORM_REGFILE);
+   switch (header->header.typeflag)
+     {
+     case SYMTYPE:
+       transform_member_name (&stat_info->link_name, XFORM_SYMLINK);
+       break;
+       
+     case LNKTYPE:
+       transform_member_name (&stat_info->link_name, XFORM_LINK);
+     }
  }
  
  /* Convert buffer at WHERE0 of size DIGS from external format to
diff --combined tests/incremental.at
index 4b1fcf314982cceb43c10f415d7ba63b2634b6c6,5873d83aa9baee16aec66d04cad318ead7d18b5a..366c0330d1d69ae943a579d030416fabc9ea3c99
@@@ -39,11 -39,14 +39,14 @@@ ls -l structure/file >/dev/nul
  # command, behaviour of tar becomes variable, depending whether the system
  # clock ticked over to the next second between creating the file and
  # backing it up.
 -sleep 1
 +sleep 2
  
  tar cf archive --listed=list structure
  tar cfv archive --listed=list structure
  echo separator
+ # ReiserFS often offsets the timestamps of newly created files
+ # 1 second to the past.  Try to compensate for it, until a better
+ # solution is found.
  sleep 2
  echo y >structure/file
  tar cfv archive --listed=list structure