svn commit: r251276 - head/usr.sbin/bsdconfig/share/packages

Devin Teske dteske at FreeBSD.org
Sun Jun 2 23:20:47 UTC 2013


Author: dteske
Date: Sun Jun  2 23:20:46 2013
New Revision: 251276
URL: http://svnweb.freebsd.org/changeset/base/251276

Log:
  Fix a bug in which the user's choice to Cancel was not recognized. This was
  caused by the standard (and correct) behavior of the shell to discard the
  return status of lvalue-operands in a pipe-chain.
  
  The solution is to not pipe the file-acquisition directly into sort(1) but
  instead store the output (allowing immediate testing of the return status)
  and later sort it.

Modified:
  head/usr.sbin/bsdconfig/share/packages/index.subr

Modified: head/usr.sbin/bsdconfig/share/packages/index.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/packages/index.subr	Sun Jun  2 23:18:27 2013	(r251275)
+++ head/usr.sbin/bsdconfig/share/packages/index.subr	Sun Jun  2 23:20:46 2013	(r251276)
@@ -70,13 +70,14 @@ f_index_initialize()
 
 	f_show_info "$msg_attempting_to_fetch_file_from_selected_media" \
 	            "$__path"
-	eval "$__var_to_set"='$( f_device_get media "$__path" | sort )'
+	eval "$__var_to_set"='$( f_device_get media "$__path" )'
 	if [ $? -ne $SUCCESS ]; then
 		f_show_msg "$msg_unable_to_get_file_from_selected_media" \
 		           "$__path"
 		f_device_shutdown media
 		return $FAILURE
 	fi
+	eval "$__var_to_set"='$( debug= f_getvar "$__var_to_set" | sort )'
 
 	f_show_info "$msg_located_index_now_reading_package_data_from_it"
 	if ! f_index_read "$__var_to_set"; then


More information about the svn-src-head mailing list