socsvn commit: r254778 - soc2013/dpl/head/contrib/xz/src/xz

dpl at FreeBSD.org dpl at FreeBSD.org
Sun Jul 14 10:29:56 UTC 2013


Author: dpl
Date: Sun Jul 14 10:29:55 2013
New Revision: 254778
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=254778

Log:
  Changed to work on all the files, that are opened before.
  

Modified:
  soc2013/dpl/head/contrib/xz/src/xz/list.c

Modified: soc2013/dpl/head/contrib/xz/src/xz/list.c
==============================================================================
--- soc2013/dpl/head/contrib/xz/src/xz/list.c	Sun Jul 14 10:28:36 2013	(r254777)
+++ soc2013/dpl/head/contrib/xz/src/xz/list.c	Sun Jul 14 10:29:55 2013	(r254778)
@@ -1057,57 +1057,45 @@
 
 
 extern void
-list_file(const char *filename)
+list_file(file_pair pairs[], int files)
 {
 	int i;
-
-	if (opt_format != FORMAT_XZ && opt_format != FORMAT_AUTO)
-		message_fatal(_("--list works only on .xz files "
-				"(--format=xz or --format=auto)"));
-
-	for ( i = 0; i < files; i++) {
-
-	message_filename(filename);
-
-	if (filename == stdin_filename) {
-		message_error(_("--list does not support reading from "
-				"standard input"));
-		continue;
-	}
+	xz_file_info xfi = XZ_FILE_INFO_INIT;
 
 	// Unset opt_stdout so that io_open_src() won't accept special files.
 	// Set opt_force so that io_open_src() will follow symlinks.
 	opt_stdout = false;
 	opt_force = true;
-	file_pair *pair = io_open_src(filename);
-	if (pair == NULL)
-		continue;
 
-	xz_file_info xfi = XZ_FILE_INFO_INIT;
-	if (!parse_indexes(&xfi, pair)) {
-		bool fail;
-
-		// We have three main modes:
-		//  - --robot, which has submodes if --verbose is specified
-		//    once or twice
-		//  - Normal --list without --verbose
-		//  - --list with one or two --verbose
-		if (opt_robot)
-			fail = print_info_robot(&xfi, pair);
-		else if (message_verbosity_get() <= V_WARNING)
-			fail = print_info_basic(&xfi, pair);
-		else
-			fail = print_info_adv(&xfi, pair);
-
-		// Update the totals that are displayed after all
-		// the individual files have been listed. Don't count
-		// broken files.
-		if (!fail)
-			update_totals(&xfi);
-
-		lzma_index_end(xfi.idx, NULL);
+	for (i = 0; i < files; i++) {
+		if (pairs[i] == NULL)
+			continue;
+	
+		if (!parse_indexes(&xfi, pairs[i])) {
+			bool fail;
+	
+			// We have three main modes:
+			//  - --robot, which has submodes if --verbose is specified
+			//    once or twice
+			//  - Normal --list without --verbose
+			//  - --list with one or two --verbose
+			if (opt_robot)
+				fail = print_info_robot(&xfi, pairs[i]);
+			else if (message_verbosity_get() <= V_WARNING)
+				fail = print_info_basic(&xfi, pairs[i]);
+			else
+				fail = print_info_adv(&xfi, pairs[i]);
+	
+			// Update the totals that are displayed after all
+			// the individual files have been listed. Don't count
+			// broken files.
+			if (!fail)
+				update_totals(&xfi);
+	
+			lzma_index_end(xfi.idx, NULL);
+		}
+	
+		io_close(pairs[i], false);
 	}
-
-	io_close(pair, false);
 	return;
 }


More information about the svn-soc-all mailing list