Date: Mon, 12 Apr 2010 09:54:15 GMT From: Garrett Cooper <gcooper@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 176827 for review Message-ID: <201004120954.o3C9sFnl014869@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@176827?ac=10 Change 176827 by gcooper@gcooper-bayonetta on 2010/04/12 09:53:17 Fix two bugs and add debug code in unpack. 1. Forgot to add archive_read(3). 2. Didn't delete leftover arguments from previous tar(1) invocation. 3. Add psuedo-tar(1)-like printouts for determining what was extracted (X) and what was skipped (S). Affected files ... .. //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/add/perform.c#4 edit .. //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/lib/file.c#9 edit Differences ... ==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/add/perform.c#4 (text+ko) ==== @@ -63,7 +63,6 @@ Package Plist; char pkg_fullname[FILENAME_MAX]; char playpen[FILENAME_MAX]; - char extract_contents[FILENAME_MAX]; char *extract; const char *where_to; FILE *cfile; @@ -129,8 +128,7 @@ warnx("can't stat package file '%s'", pkg_fullname); goto bomb; } - sprintf(extract_contents, "--fast-read %s", CONTENTS_FNAME); - extract = extract_contents; + extract = CONTENTS_FNAME; } else { extract = NULL; ==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/lib/file.c#9 (text+ko) ==== @@ -355,8 +355,17 @@ if (file_expr == NULL || strcmp("*", file_expr) == 0) extract_whole_archive = TRUE; + if (Verbose) { + if (extract_whole_archive) + printf("%s: will extract whole archive\n", __func__); + else + printf("%s: will extract files that match: %s\n", + __func__, file_expr); + } + pkg_name_humanized = strcmp(pkg, "-") == 0 ? "(stdin)" : pkg; + archive = archive_read_new(); archive_read_support_compression_all(archive); archive_read_support_format_tar(archive); @@ -388,7 +397,14 @@ "%s", __func__, pkg_name_humanized, error); } + if (Verbose) { + printf("X - %s\n", + archive_entry_pathname(archive_entry)); + } + } else if (Verbose) { + printf("S - %s\n", + archive_entry_pathname(archive_entry)); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004120954.o3C9sFnl014869>