From owner-freebsd-sysinstall@FreeBSD.ORG Thu May 15 02:35:33 2014 Return-Path: Delivered-To: freebsd-sysinstall@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13DC5DB4; Thu, 15 May 2014 02:35:33 +0000 (UTC) Received: from mx1.scaleengine.net (beauharnois2.bhs1.scaleengine.net [142.4.218.15]) by mx1.freebsd.org (Postfix) with ESMTP id E351625A7; Thu, 15 May 2014 02:35:32 +0000 (UTC) Received: from [10.2.255.195] (unknown [137.122.78.10]) (Authenticated sender: roleaccount@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 3785D73B40; Thu, 15 May 2014 02:35:31 +0000 (UTC) Message-ID: <537427F2.3080902@allanjude.com> Date: Wed, 14 May 2014 22:35:30 -0400 From: Allan Jude User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Devin Teske , roberto@freebsd.org Subject: Re: bsdinstall patch [3/3] variable reuse References: <53741CD0.9000403@allanjude.com> In-Reply-To: <53741CD0.9000403@allanjude.com> Content-Type: multipart/mixed; boundary="------------090203020005020901010506" Cc: freebsd-sysinstall@freebsd.org X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 May 2014 02:35:33 -0000 This is a multi-part message in MIME format. --------------090203020005020901010506 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 05/14/2014 21:48, Allan Jude wrote: > dteske@ reused the variable 'disks' in zfsboot > > it starts off being used to track the grammar for the number of disks > (singular vs plural) > > and then it is reused as the list of available disks > > replace the variable with disks_grammar and move 'disk' and 'disks' to > msg_ vars so they can be translated in the future. > > > > _______________________________________________ > freebsd-sysinstall@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-sysinstall > To unsubscribe, send any mail to "freebsd-sysinstall-unsubscribe@freebsd.org" > Rebased patch with the previous 2 patches applied --------------090203020005020901010506 Content-Type: text/x-patch; name="zfsboot.grammar.v2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="zfsboot.grammar.v2.patch" Index: usr.sbin/bsdinstall/scripts/zfsboot =================================================================== --- usr.sbin/bsdinstall/scripts/zfsboot (revision 266108) +++ usr.sbin/bsdinstall/scripts/zfsboot (working copy) @@ -220,6 +220,8 @@ msg_detailed_disk_info="gpart(8) show %s:\n%s\n\ncamcontrol(8) inquiry %s:\n%s\n\n\ncamcontrol(8) identify %s:\n%s\n" msg_disk_info="Disk Info" msg_disk_info_help="Get detailed information on disk device(s)" +msg_disk_singular="disk" +msg_disk_plural="disks" msg_encrypt_disks="Encrypt Disks?" msg_encrypt_disks_help="Use geli(8) to encrypt all data partitions" msg_error="Error" @@ -306,13 +308,14 @@ [ "$ZFSBOOT_GELI_ENCRYPTION" ] && usegeli="$msg_yes" [ "$ZFSBOOT_SWAP_ENCRYPTION" ] && swapgeli="$msg_yes" [ "$ZFSBOOT_SWAP_MIRROR" ] && swapmirror="$msg_yes" - local disks n + local disks n disks_grammar f_count n $ZFSBOOT_DISKS - { [ $n -eq 1 ] && disks=disk; } || disks=disks # grammar + { [ $n -eq 1 ] && disks_grammar=$msg_disk_singular; } || + disks_grammar=$msg_disk_plural # grammar local menu_list=" '>>> $msg_install' '$msg_install_desc' '$msg_install_help' - 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks' + 'T $msg_pool_type_disks' '$ZFSBOOT_VDEV_TYPE: $n $disks_grammar' '$msg_pool_type_disks_help' '- $msg_rescan_devices' '*' '$msg_rescan_devices_help' --------------090203020005020901010506--