wok-6.x diff busybox/stuff/busybox-1.23-dpkgxz.u @ rev 18368
Up rdesktop (1.8.3)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Sep 16 16:30:38 2015 +0200 (2015-09-16) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.23-dpkgxz.u Wed Sep 16 16:30:38 2015 +0200 1.3 @@ -0,0 +1,163 @@ 1.4 +Description: Add support for latest .deb format members 1.5 + This adds support for control.tar, control.tar.xz, data.tar, data.tar.xz 1.6 + and data.tar.lzma in the dpkg and dpkg-deb applet. It also removes support 1.7 + for control.tar.bz2 which has never been supported. 1.8 + . 1.9 + This should make these applets conform to deb(5). 1.10 +Author: Guillem Jover <guillem@debian.org> 1.11 +Origin: vendor 1.12 +Forwarded: no 1.13 +Last-Update: 2014-07-30 1.14 +Bug-Debian: http://bugs.debian.org/756462 1.15 +--- 1.16 + archival/dpkg.c | 12 ++++++++++-- 1.17 + archival/dpkg_deb.c | 6 ++++++ 1.18 + archival/libarchive/Kbuild.src | 1 + 1.19 + archival/libarchive/filter_accept_list_reassign.c | 11 +++++++++++ 1.20 + archival/libarchive/get_header_tar_xz.c | 21 +++++++++++++++++++++ 1.21 + include/bb_archive.h | 1 + 1.22 + 6 files changed, 50 insertions(+), 2 deletions(-) 1.23 + create mode 100644 archival/libarchive/get_header_tar_xz.c 1.24 + 1.25 +diff --git a/archival/dpkg.c b/archival/dpkg.c 1.26 +index 2893cfc..71eae66 100644 1.27 +--- a/archival/dpkg.c 1.28 ++++ b/archival/dpkg.c 1.29 +@@ -1472,11 +1472,12 @@ static void init_archive_deb_control(archive_handle_t *ar_handle) 1.30 + tar_handle->src_fd = ar_handle->src_fd; 1.31 + 1.32 + /* We don't care about data.tar.* or debian-binary, just control.tar.* */ 1.33 ++ llist_add_to(&(ar_handle->accept), (char*)"control.tar"); 1.34 + #if ENABLE_FEATURE_SEAMLESS_GZ 1.35 + llist_add_to(&(ar_handle->accept), (char*)"control.tar.gz"); 1.36 + #endif 1.37 +-#if ENABLE_FEATURE_SEAMLESS_BZ2 1.38 +- llist_add_to(&(ar_handle->accept), (char*)"control.tar.bz2"); 1.39 ++#if ENABLE_FEATURE_SEAMLESS_XZ 1.40 ++ llist_add_to(&(ar_handle->accept), (char*)"control.tar.xz"); 1.41 + #endif 1.42 + 1.43 + /* Assign the tar handle as a subarchive of the ar handle */ 1.44 +@@ -1492,12 +1493,19 @@ static void init_archive_deb_data(archive_handle_t *ar_handle) 1.45 + tar_handle->src_fd = ar_handle->src_fd; 1.46 + 1.47 + /* We don't care about control.tar.* or debian-binary, just data.tar.* */ 1.48 ++ llist_add_to(&(ar_handle->accept), (char*)"data.tar"); 1.49 + #if ENABLE_FEATURE_SEAMLESS_GZ 1.50 + llist_add_to(&(ar_handle->accept), (char*)"data.tar.gz"); 1.51 + #endif 1.52 ++#if ENABLE_FEATURE_SEAMLESS_XZ 1.53 ++ llist_add_to(&(ar_handle->accept), (char*)"data.tar.xz"); 1.54 ++#endif 1.55 + #if ENABLE_FEATURE_SEAMLESS_BZ2 1.56 + llist_add_to(&(ar_handle->accept), (char*)"data.tar.bz2"); 1.57 + #endif 1.58 ++#if ENABLE_FEATURE_SEAMLESS_LZMA 1.59 ++ llist_add_to(&(ar_handle->accept), (char*)"data.tar.lzma"); 1.60 ++#endif 1.61 + 1.62 + /* Assign the tar handle as a subarchive of the ar handle */ 1.63 + ar_handle->dpkg__sub_archive = tar_handle; 1.64 +diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c 1.65 +index 13f9db9..48920f6 100644 1.66 +--- a/archival/dpkg_deb.c 1.67 ++++ b/archival/dpkg_deb.c 1.68 +@@ -70,10 +70,16 @@ int dpkg_deb_main(int argc, char **argv) 1.69 + ar_archive->dpkg__sub_archive = tar_archive; 1.70 + ar_archive->filter = filter_accept_list_reassign; 1.71 + 1.72 ++ llist_add_to(&ar_archive->accept, (char*)"data.tar"); 1.73 ++ llist_add_to(&control_tar_llist, (char*)"control.tar"); 1.74 + #if ENABLE_FEATURE_SEAMLESS_GZ 1.75 + llist_add_to(&ar_archive->accept, (char*)"data.tar.gz"); 1.76 + llist_add_to(&control_tar_llist, (char*)"control.tar.gz"); 1.77 + #endif 1.78 ++#if ENABLE_FEATURE_SEAMLESS_XZ 1.79 ++ llist_add_to(&ar_archive->accept, (char*)"data.tar.xz"); 1.80 ++ llist_add_to(&control_tar_llist, (char*)"control.tar.xz"); 1.81 ++#endif 1.82 + #if ENABLE_FEATURE_SEAMLESS_BZ2 1.83 + llist_add_to(&ar_archive->accept, (char*)"data.tar.bz2"); 1.84 + llist_add_to(&control_tar_llist, (char*)"control.tar.bz2"); 1.85 +diff --git a/archival/libarchive/Kbuild.src b/archival/libarchive/Kbuild.src 1.86 +index 968fdf8..fda05d8 100644 1.87 +--- a/archival/libarchive/Kbuild.src 1.88 ++++ b/archival/libarchive/Kbuild.src 1.89 +@@ -33,6 +33,7 @@ DPKG_FILES:= \ 1.90 + get_header_ar.o \ 1.91 + get_header_tar.o \ 1.92 + get_header_tar_gz.o \ 1.93 ++ get_header_tar_xz.o \ 1.94 + get_header_tar_bz2.o \ 1.95 + get_header_tar_lzma.o \ 1.96 + 1.97 +diff --git a/archival/libarchive/filter_accept_list_reassign.c b/archival/libarchive/filter_accept_list_reassign.c 1.98 +index 3d19abe..bcfeb96 100644 1.99 +--- a/archival/libarchive/filter_accept_list_reassign.c 1.100 ++++ b/archival/libarchive/filter_accept_list_reassign.c 1.101 +@@ -28,12 +28,23 @@ char FAST_FUNC filter_accept_list_reassign(archive_handle_t *archive_handle) 1.102 + name_ptr++; 1.103 + 1.104 + /* Modify the subarchive handler based on the extension */ 1.105 ++ if (strcmp(name_ptr, "tar") == 0 1.106 ++ ) { 1.107 ++ archive_handle->dpkg__action_data_subarchive = get_header_tar; 1.108 ++ return EXIT_SUCCESS; 1.109 ++ } 1.110 + if (ENABLE_FEATURE_SEAMLESS_GZ 1.111 + && strcmp(name_ptr, "gz") == 0 1.112 + ) { 1.113 + archive_handle->dpkg__action_data_subarchive = get_header_tar_gz; 1.114 + return EXIT_SUCCESS; 1.115 + } 1.116 ++ if (ENABLE_FEATURE_SEAMLESS_XZ 1.117 ++ && strcmp(name_ptr, "xz") == 0 1.118 ++ ) { 1.119 ++ archive_handle->dpkg__action_data_subarchive = get_header_tar_xz; 1.120 ++ return EXIT_SUCCESS; 1.121 ++ } 1.122 + if (ENABLE_FEATURE_SEAMLESS_BZ2 1.123 + && strcmp(name_ptr, "bz2") == 0 1.124 + ) { 1.125 +diff --git a/archival/libarchive/get_header_tar_xz.c b/archival/libarchive/get_header_tar_xz.c 1.126 +new file mode 100644 1.127 +index 0000000..30ac522 1.128 +--- /dev/null 1.129 ++++ b/archival/libarchive/get_header_tar_xz.c 1.130 +@@ -0,0 +1,21 @@ 1.131 ++/* vi: set sw=4 ts=4: */ 1.132 ++/* 1.133 ++ * Licensed under GPLv2 or later, see file LICENSE in this source tree. 1.134 ++ */ 1.135 ++ 1.136 ++#include "libbb.h" 1.137 ++#include "bb_archive.h" 1.138 ++ 1.139 ++char FAST_FUNC get_header_tar_xz(archive_handle_t *archive_handle) 1.140 ++{ 1.141 ++ /* Can't lseek over pipes */ 1.142 ++ archive_handle->seek = seek_by_read; 1.143 ++ 1.144 ++ fork_transformer_with_sig(archive_handle->src_fd, unpack_xz_stream, "unxz"); 1.145 ++ archive_handle->offset = 0; 1.146 ++ while (get_header_tar(archive_handle) == EXIT_SUCCESS) 1.147 ++ continue; 1.148 ++ 1.149 ++ /* Can only do one file at a time */ 1.150 ++ return EXIT_FAILURE; 1.151 ++} 1.152 +diff --git a/include/bb_archive.h b/include/bb_archive.h 1.153 +index b82cfd8..a356f70 100644 1.154 +--- a/include/bb_archive.h 1.155 ++++ b/include/bb_archive.h 1.156 +@@ -182,6 +182,7 @@ char get_header_ar(archive_handle_t *archive_handle) FAST_FUNC; 1.157 + char get_header_cpio(archive_handle_t *archive_handle) FAST_FUNC; 1.158 + char get_header_tar(archive_handle_t *archive_handle) FAST_FUNC; 1.159 + char get_header_tar_gz(archive_handle_t *archive_handle) FAST_FUNC; 1.160 ++char get_header_tar_xz(archive_handle_t *archive_handle) FAST_FUNC; 1.161 + char get_header_tar_bz2(archive_handle_t *archive_handle) FAST_FUNC; 1.162 + char get_header_tar_lzma(archive_handle_t *archive_handle) FAST_FUNC; 1.163 + 1.164 +-- 1.165 +1.7.10.4 1.166 +