[tar] tar: allow extracting from just single volume

Pavel Raiskup praiskup at fedoraproject.org
Tue Mar 19 13:00:16 UTC 2013


commit b40bf4511ce0e633a7760f9cb031914524b59428
Author: Pavel Raiskup <praiskup at redhat.com>
Date:   Tue Mar 19 09:51:51 2013 +0100

    tar: allow extracting from just single volume
    
    Resolves: #919897
    Version: 2:1.26-20

 tar-1.26-allow-extract-single-volume.patch |   27 +++++++++++++++++++++++++++
 tar.spec                                   |   12 +++++++++++-
 2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/tar-1.26-allow-extract-single-volume.patch b/tar-1.26-allow-extract-single-volume.patch
new file mode 100644
index 0000000..6ec830d
--- /dev/null
+++ b/tar-1.26-allow-extract-single-volume.patch
@@ -0,0 +1,27 @@
+diff --git a/src/extract.c b/src/extract.c
+index 87b383a..340beea 100644
+--- a/src/extract.c
++++ b/src/extract.c
+@@ -1415,6 +1415,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);
+ 
+ 
+@@ -1495,7 +1502,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:
diff --git a/tar.spec b/tar.spec
index 13e8602..21f6a58 100644
--- a/tar.spec
+++ b/tar.spec
@@ -5,7 +5,7 @@ Summary: A GNU file archiving program
 Name: tar
 Epoch: 2
 Version: 1.26
-Release: 19%{?dist}
+Release: 20%{?dist}
 License: GPLv3+
 Group: Applications/Archiving
 URL: http://www.gnu.org/software/tar/
@@ -82,6 +82,12 @@ Patch11: tar-1.26-posix-biguid.patch
 # ~> already upstream (2f6c03cba)
 Patch12: tar-1.26-pax-big-sparse-files.patch
 
+# Fix: Allow extracting single volume in a multi-volume archive
+# ~> #919897
+# ~> http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00002.html
+# ~> upstream (beca89bc)
+Patch13: tar-1.26-allow-extract-single-volume.patch
+
 # run "make check" by default
 %bcond_without check
 
@@ -125,6 +131,7 @@ the rmt package.
 %patch10 -p1 -b .xattrs-selinux-acls
 %patch11 -p1 -b .big_uid_gid
 %patch12 -p1 -b .pax-sparse-big-files
+%patch13 -p1 -b .extract-single-volume
 
 autoreconf -v
 
@@ -187,6 +194,9 @@ fi
 %{_infodir}/tar.info*
 
 %changelog
+* Tue Mar 19 2013 Pavel Raiskup <praiskup at redhat.com> - 2:1.26-20
+- allow extracting single volume from multi-volume archive (#919897)
+
 * Fri Mar 01 2013 Pavel Raiskup <praiskup at redhat.com> - 2:1.26-19
 - fix creating sparse pax archives containing files of effective
   size >8GB (#516309)


More information about the scm-commits mailing list