projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tar -Z, uncompress support
[oweals/busybox.git]
/
archival
/
dpkg_deb.c
diff --git
a/archival/dpkg_deb.c
b/archival/dpkg_deb.c
index c4673955332994b5b21bd3c45e85b3b45bc9ea35..2d7383fd7988f62b2844ca8d27312dc8bed80b24 100644
(file)
--- a/
archival/dpkg_deb.c
+++ b/
archival/dpkg_deb.c
@@
-27,15
+27,8
@@
extern int dpkg_deb_main(int argc, char **argv)
archive_handle_t *tar_archive;
int opt = 0;
#ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
archive_handle_t *tar_archive;
int opt = 0;
#ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
-
const
llist_t *control_tar_llist = NULL;
+ llist_t *control_tar_llist = NULL;
#endif
#endif
-#ifndef CONFIG_AR
- char magic[7];
-#endif
-
- /* a .deb file is an ar archive that contain three files,
- * data.tar.gz, control.tar.gz and debian
- */
/* Setup the tar archive handle */
tar_archive = init_handle();
/* Setup the tar archive handle */
tar_archive = init_handle();
@@
-46,16
+39,16
@@
extern int dpkg_deb_main(int argc, char **argv)
ar_archive->filter = filter_accept_list_reassign;
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
ar_archive->filter = filter_accept_list_reassign;
#ifdef CONFIG_FEATURE_DEB_TAR_GZ
- ar_archive->accept =
add_to_list
(NULL, "data.tar.gz");
+ ar_archive->accept =
llist_add_to
(NULL, "data.tar.gz");
# ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
# ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
- control_tar_llist =
add_to_list
(NULL, "control.tar.gz");
+ control_tar_llist =
llist_add_to
(NULL, "control.tar.gz");
# endif
#endif
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
# endif
#endif
#ifdef CONFIG_FEATURE_DEB_TAR_BZ2
- ar_archive->accept =
add_to_list
(ar_archive->accept, "data.tar.bz2");
+ ar_archive->accept =
llist_add_to
(ar_archive->accept, "data.tar.bz2");
# ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
# ifndef CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
- control_tar_llist =
add_to_list
(control_tar_llist, "control.tar.bz2");
+ control_tar_llist =
llist_add_to
(control_tar_llist, "control.tar.bz2");
# endif
#endif
# endif
#endif
@@
-78,7
+71,7
@@
extern int dpkg_deb_main(int argc, char **argv)
* it should accept a second argument which specifies a
* specific field to print */
ar_archive->accept = control_tar_llist;
* it should accept a second argument which specifies a
* specific field to print */
ar_archive->accept = control_tar_llist;
- tar_archive->accept =
add_to_list
(NULL, "./control");;
+ tar_archive->accept =
llist_add_to
(NULL, "./control");;
tar_archive->filter = filter_accept_list;
tar_archive->action_data = data_extract_to_stdout;
break;
tar_archive->filter = filter_accept_list;
tar_archive->action_data = data_extract_to_stdout;
break;
@@
-89,32
+82,22
@@
extern int dpkg_deb_main(int argc, char **argv)
tar_archive->action_data = data_extract_all;
break;
default:
tar_archive->action_data = data_extract_all;
break;
default:
- show_usage();
+
bb_
show_usage();
}
}
if (optind + 2 < argc) {
}
}
if (optind + 2 < argc) {
- show_usage();
+
bb_
show_usage();
}
}
- tar_archive->src_fd = ar_archive->src_fd = xopen(argv[optind++], O_RDONLY);
+ tar_archive->src_fd = ar_archive->src_fd =
bb_
xopen(argv[optind++], O_RDONLY);
/* Workout where to extract the files */
/* 2nd argument is a dir name */
mkdir(argv[optind], 0777);
chdir(argv[optind]);
/* Workout where to extract the files */
/* 2nd argument is a dir name */
mkdir(argv[optind], 0777);
chdir(argv[optind]);
-#ifdef CONFIG_AR
unpack_ar_archive(ar_archive);
unpack_ar_archive(ar_archive);
-#else
- xread_all(ar_archive->src_fd, magic, 7);
- if (strncmp(magic, "!<arch>", 7) != 0) {
- error_msg_and_die("Invalid ar magic");
- }
- ar_archive->offset += 7;
-
- while (get_header_ar(ar_archive) == EXIT_SUCCESS);
-#endif
/* Cleanup */
close (ar_archive->src_fd);
/* Cleanup */
close (ar_archive->src_fd);