diff options
Diffstat (limited to 'archivers/libarchive/files/tar/read.c')
-rw-r--r-- | archivers/libarchive/files/tar/read.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/archivers/libarchive/files/tar/read.c b/archivers/libarchive/files/tar/read.c index 279a10549d7..e1905b24867 100644 --- a/archivers/libarchive/files/tar/read.c +++ b/archivers/libarchive/files/tar/read.c @@ -24,7 +24,7 @@ */ #include "bsdtar_platform.h" -__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.36 2008/03/15 03:06:46 kientzle Exp $"); +__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.37 2008/05/18 06:24:47 cperciva Exp $"); #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -77,12 +77,28 @@ void tar_mode_t(struct bsdtar *bsdtar) { read_archive(bsdtar, 't'); + unmatched_inclusions_warn(bsdtar, "Not found in archive"); } void tar_mode_x(struct bsdtar *bsdtar) { + /* We want to catch SIGINFO and SIGUSR1. */ + siginfo_init(bsdtar); + read_archive(bsdtar, 'x'); + + unmatched_inclusions_warn(bsdtar, "Not found in archive"); + /* Restore old SIGINFO + SIGUSR1 handlers. */ + siginfo_done(bsdtar); +} + +static void +progress_func(void * cookie) +{ + struct bsdtar * bsdtar = cookie; + + siginfo_printinfo(bsdtar, 0); } /* @@ -119,6 +135,12 @@ read_archive(struct bsdtar *bsdtar, char mode) do_chdir(bsdtar); + if (mode == 'x') { + /* Set an extract callback so that we can handle SIGINFO. */ + archive_read_extract_set_progress_callback(a, progress_func, + bsdtar); + } + if (mode == 'x' && bsdtar->option_chroot) { #if HAVE_CHROOT if (chroot(".") != 0) @@ -150,6 +172,11 @@ read_archive(struct bsdtar *bsdtar, char mode) if (r == ARCHIVE_FATAL) break; + if (bsdtar->option_numeric_owner) { + archive_entry_set_uname(entry, NULL); + archive_entry_set_gname(entry, NULL); + } + /* * Exclude entries that are too old. */ @@ -238,6 +265,12 @@ read_archive(struct bsdtar *bsdtar, char mode) archive_entry_pathname(entry)); fflush(stderr); } + + /* Tell the SIGINFO-handler code what we're doing. */ + siginfo_setinfo(bsdtar, "extracting", + archive_entry_pathname(entry), 0); + siginfo_printinfo(bsdtar, 0); + if (bsdtar->option_stdout) r = archive_read_data_into_fd(a, 1); else |