tar_handle->src_fd = ar_handle->src_fd;
/* We don't care about data.tar.* or debian-binary, just control.tar.* */
+ llist_add_to(&(ar_handle->accept), (char*)"control.tar");
#if ENABLE_FEATURE_SEAMLESS_GZ
llist_add_to(&(ar_handle->accept), (char*)"control.tar.gz");
#endif
#if ENABLE_FEATURE_SEAMLESS_BZ2
llist_add_to(&(ar_handle->accept), (char*)"control.tar.bz2");
#endif
+#if ENABLE_FEATURE_SEAMLESS_XZ
+ llist_add_to(&(ar_handle->accept), (char*)"control.tar.xz");
+#endif
/* Assign the tar handle as a subarchive of the ar handle */
ar_handle->dpkg__sub_archive = tar_handle;
tar_handle->src_fd = ar_handle->src_fd;
/* We don't care about control.tar.* or debian-binary, just data.tar.* */
+ llist_add_to(&(ar_handle->accept), (char*)"data.tar");
#if ENABLE_FEATURE_SEAMLESS_GZ
llist_add_to(&(ar_handle->accept), (char*)"data.tar.gz");
#endif
#if ENABLE_FEATURE_SEAMLESS_BZ2
llist_add_to(&(ar_handle->accept), (char*)"data.tar.bz2");
#endif
+#if ENABLE_FEATURE_SEAMLESS_LZMA
+ llist_add_to(&(ar_handle->accept), (char*)"data.tar.lzma");
+#endif
+#if ENABLE_FEATURE_SEAMLESS_XZ
+ llist_add_to(&(ar_handle->accept), (char*)"data.tar.xz");
+#endif
/* Assign the tar handle as a subarchive of the ar handle */
ar_handle->dpkg__sub_archive = tar_handle;
ar_archive->dpkg__sub_archive = tar_archive;
ar_archive->filter = filter_accept_list_reassign;
+ llist_add_to(&ar_archive->accept, (char*)"data.tar");
+ llist_add_to(&control_tar_llist, (char*)"control.tar");
#if ENABLE_FEATURE_SEAMLESS_GZ
llist_add_to(&ar_archive->accept, (char*)"data.tar.gz");
llist_add_to(&control_tar_llist, (char*)"control.tar.gz");
llist_add_to(&ar_archive->accept, (char*)"data.tar.lzma");
llist_add_to(&control_tar_llist, (char*)"control.tar.lzma");
#endif
+#if ENABLE_FEATURE_SEAMLESS_XZ
+ llist_add_to(&ar_archive->accept, (char*)"data.tar.xz");
+ llist_add_to(&control_tar_llist, (char*)"control.tar.xz");
+#endif
opt_complementary = "c--efXx:e--cfXx:f--ceXx:X--cefx:x--cefX";
opt = getopt32(argv, "cefXx");
get_header_tar_gz.o \
get_header_tar_bz2.o \
get_header_tar_lzma.o \
+ get_header_tar_xz.o \
INSERT
name_ptr++;
/* Modify the subarchive handler based on the extension */
+ if (strcmp(name_ptr, "tar") == 0) {
+ archive_handle->dpkg__action_data_subarchive = get_header_tar;
+ return EXIT_SUCCESS;
+ }
if (ENABLE_FEATURE_SEAMLESS_GZ
&& strcmp(name_ptr, "gz") == 0
) {
archive_handle->dpkg__action_data_subarchive = get_header_tar_lzma;
return EXIT_SUCCESS;
}
+ if (ENABLE_FEATURE_SEAMLESS_XZ
+ && strcmp(name_ptr, "xz") == 0
+ ) {
+ archive_handle->dpkg__action_data_subarchive = get_header_tar_xz;
+ return EXIT_SUCCESS;
+ }
}
return EXIT_FAILURE;
}
--- /dev/null
+/* vi: set sw=4 ts=4: */
+/*
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
+ */
+
+#include "libbb.h"
+#include "bb_archive.h"
+
+char FAST_FUNC get_header_tar_xz(archive_handle_t *archive_handle)
+{
+ /* Can't lseek over pipes */
+ archive_handle->seek = seek_by_read;
+
+ fork_transformer_with_sig(archive_handle->src_fd, unpack_xz_stream, "unxz");
+ archive_handle->offset = 0;
+ while (get_header_tar(archive_handle) == EXIT_SUCCESS)
+ continue;
+
+ /* Can only do one file at a time */
+ return EXIT_FAILURE;
+}
char get_header_tar_gz(archive_handle_t *archive_handle) FAST_FUNC;
char get_header_tar_bz2(archive_handle_t *archive_handle) FAST_FUNC;
char get_header_tar_lzma(archive_handle_t *archive_handle) FAST_FUNC;
+char get_header_tar_xz(archive_handle_t *archive_handle) FAST_FUNC;
void seek_by_jump(int fd, off_t amount) FAST_FUNC;
void seek_by_read(int fd, off_t amount) FAST_FUNC;