diff options
author | sobomax <sobomax@FreeBSD.org> | 2002-09-09 06:06:09 +0000 |
---|---|---|
committer | sobomax <sobomax@FreeBSD.org> | 2002-09-09 06:06:09 +0000 |
commit | 5f3f30f263f5c5e9e0ec3d49ff5d0b3bc2496ecb (patch) | |
tree | c4b8ba818658bfd414042b42cd72429939e12979 /usr.sbin/pkg_install/info/perform.c | |
parent | b482de8733d843345f5cdc15a562499d003aae20 (diff) | |
download | FreeBSD-src-5f3f30f263f5c5e9e0ec3d49ff5d0b3bc2496ecb.zip FreeBSD-src-5f3f30f263f5c5e9e0ec3d49ff5d0b3bc2496ecb.tar.gz |
Use --fast-read mode to extract metadata from package file. Since metadata
files are located at the very beginning of the package, this patch in
conjuction with latest tar(1) --fast-mode fix greatly speeds up pkg_info(1)
operation on package files.
MFC after: 1 week
Diffstat (limited to 'usr.sbin/pkg_install/info/perform.c')
-rw-r--r-- | usr.sbin/pkg_install/info/perform.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/info/perform.c b/usr.sbin/pkg_install/info/perform.c index e9581f1..d87dd13 100644 --- a/usr.sbin/pkg_install/info/perform.c +++ b/usr.sbin/pkg_install/info/perform.c @@ -88,7 +88,7 @@ pkg_do(char *pkg) { Boolean installed = FALSE, isTMP = FALSE; char log_dir[FILENAME_MAX]; - char fname[FILENAME_MAX]; + char fname[FILENAME_MAX], extrlist[FILENAME_MAX]; Package plist; FILE *fp; struct stat sb; @@ -131,7 +131,21 @@ pkg_do(char *pkg) goto bail; } Home = make_playpen(PlayPen, sb.st_size / 2); - if (unpack(fname, "+*")) { + snprintf(extrlist, sizeof(extrlist), "--fast-read %s %s %s", + CONTENTS_FNAME, COMMENT_FNAME, DESC_FNAME); + if (Flags & SHOW_DISPLAY) + snprintf(extrlist, sizeof(extrlist), "%s %s", extrlist, + DISPLAY_FNAME); + if (Flags & SHOW_INSTALL) + snprintf(extrlist, sizeof(extrlist), "%s %s %s", extrlist, + INSTALL_FNAME, POST_INSTALL_FNAME); + if (Flags & SHOW_DEINSTALL) + snprintf(extrlist, sizeof(extrlist), "%s %s %s", extrlist, + DEINSTALL_FNAME, POST_DEINSTALL_FNAME); + if (Flags & SHOW_MTREE) + snprintf(extrlist, sizeof(extrlist), "%s %s", extrlist, + MTREE_FNAME); + if (unpack(fname, extrlist)) { warnx("error during unpacking, no info for '%s' available", pkg); code = 1; goto bail; |