view sources/patches/busybox-fixtar.patch @ 219:11e99cacb09e

Fix the old busybox tar so it can extract linux kernel tarballs.
author Rob Landley <rob@landley.net>
date Mon, 17 Sep 2007 21:58:21 -0500
parents
children
line wrap: on
line source

--- busybox-1.2.2/archival/libunarchive/get_header_tar.c	2006-07-28 17:53:44.000000000 -0500
+++ busybox-new/archival/libunarchive/get_header_tar.c	2007-09-17 21:50:44.000000000 -0500
@@ -51,6 +51,7 @@
 	long sum = 0;
 	long i;
 	static int end = 0;
+	int skippy = 0;
 
 	/* Align header */
 	data_align(archive_handle, 512);
@@ -183,10 +184,12 @@
 	case 'N':	/* Old GNU for names > 100 characters */
 	case 'S':	/* Sparse file */
 	case 'V':	/* Volume header */
+		bb_error_msg("Ignoring extension type %c", tar.formated.typeflag);
+		break;
 #endif
 	case 'g':	/* pax global header */
 	case 'x':	/* pax extended header */
-		bb_error_msg("Ignoring extension type %c", tar.formated.typeflag);
+		skippy = 1;
 		break;
 	default:
 		bb_error_msg("Unknown typeflag: 0x%x", tar.formated.typeflag);
@@ -199,7 +202,7 @@
 		}
 	}
 
-	if (archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
+	if (!skippy && archive_handle->filter(archive_handle) == EXIT_SUCCESS) {
 		archive_handle->action_header(archive_handle->file_header);
 		archive_handle->flags |= ARCHIVE_EXTRACT_QUIET;
 		archive_handle->action_data(archive_handle);