]> Dogcows Code - chaz/tar/commitdiff
(list_archive): Handle incremental backups in pax
authorSergey Poznyakoff <gray@gnu.org.ua>
Mon, 7 Nov 2005 02:49:23 +0000 (02:49 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Mon, 7 Nov 2005 02:49:23 +0000 (02:49 +0000)
format.
(decode_header): Initialize stat_info.dumpdir

src/list.c

index 667607d7a196a563426254d3afcbe4762a2b7eb1..5bbd3cbe25ac594ea0aba28bb9c0bc05d12d3858 100644 (file)
@@ -205,46 +205,21 @@ read_and (void (*do_something) (void))
 void
 list_archive (void)
 {
+  off_t block_ordinal = current_block_ordinal ();
   /* Print the header block.  */
 
   decode_header (current_header, &current_stat_info, &current_format, 0);
   if (verbose_option)
-    print_header (&current_stat_info, -1);
+    print_header (&current_stat_info, block_ordinal);
   
-  if (incremental_option && current_header->header.typeflag == GNUTYPE_DUMPDIR)
+  if (incremental_option)
     {
-      off_t size;
-      size_t written, check;
-      union block *data_block;
-
-      set_next_block_after (current_header);
-      if (multi_volume_option)
+      if (verbose_option > 2)
        {
-         assign_string (&save_name, current_stat_info.orig_file_name);
-         save_totsize = current_stat_info.stat.st_size;
-       }
-      for (size = current_stat_info.stat.st_size; size > 0; size -= written)
-       {
-         if (multi_volume_option)
-           save_sizeleft = size;
-         data_block = find_next_block ();
-         if (!data_block)
-           {
-             ERROR ((0, 0, _("Unexpected EOF in archive")));
-             break;            /* FIXME: What happens, then?  */
-           }
-         written = available_space_after (data_block);
-         if (written > size)
-           written = size;
-         set_next_block_after ((union block *)
-                               (data_block->buffer + written - 1));
-         if (verbose_option > 2)
-           list_dumpdir (data_block->buffer, written);
+         if (current_stat_info.dumpdir)
+           list_dumpdir (current_stat_info.dumpdir,
+                         dumpdir_size (current_stat_info.dumpdir));
        }
-      if (multi_volume_option)
-       assign_string (&save_name, 0);
-
-      return;
     }
 
   if (multi_volume_option)
@@ -601,7 +576,13 @@ decode_header (union block *header, struct tar_stat_info *stat_info,
       stat_info->is_sparse = true;
     }
   else
-    stat_info->is_sparse = false;
+    {
+      stat_info->is_sparse = false;
+      if ((current_format == GNU_FORMAT
+          || current_format == OLDGNU_FORMAT)
+         && current_header->header.typeflag == GNUTYPE_DUMPDIR)
+       get_gnu_dumpdir ();
+    }
 }
 
 /* Convert buffer at WHERE0 of size DIGS from external format to
This page took 0.023855 seconds and 4 git commands to generate.