[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] Extracting from a single volume in a multi-volume archive
From: |
Sergey Poznyakoff |
Subject: |
Re: [Bug-tar] Extracting from a single volume in a multi-volume archive fails |
Date: |
Sat, 09 Mar 2013 22:07:44 +0300 |
Hi Göran,
> freddi$$ tar --extract --blocking-factor=1 --file=x2.tar c
> tar: b: Cannot extract -- file is continued from another volume
> tar: c: Not found in archive
That is definitely a bug. Thanks for reporting it. Attached is a patch
that allows to continue extracting in such cases. Note, however, that
in order to extract a split member (i.e. the one contained in several
volumes), you will always have to start from the volume that contains
its beginning, as the documentation says:
If an archive member is split across volumes (i.e., its entry begins
on one volume of the media and ends on another), you need to specify
`--multi-volume' to extract it successfully. In this case, you should
load the volume where the archive member starts, and use `tar --extract
--multi-volume'--`tar' will prompt for later volumes as it needs them.
Regards,
Sergey
diff --git a/src/extract.c b/src/extract.c
index 327b67f..faee4eb 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -1421,6 +1421,13 @@ extract_failure (char *file_name, int typeflag)
return 1;
}
+static int
+extract_skip (char *file_name, int typeflag)
+{
+ skip_member ();
+ return 0;
+}
+
typedef int (*tar_extractor_t) (char *file_name, int typeflag);
@@ -1501,7 +1508,7 @@ prepare_to_extract (char const *file_name, int typeflag,
tar_extractor_t *fun)
ERROR ((0, 0,
_("%s: Cannot extract -- file is continued from another volume"),
quotearg_colon (current_stat_info.file_name)));
- *fun = extract_failure;
+ *fun = extract_skip;
break;
case GNUTYPE_LONGNAME: