Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Oct 2012 18:14:27 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r241902 - in head/usr.sbin/bsdinstall: . scripts
Message-ID:  <201210221814.q9MIERFb068467@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Mon Oct 22 18:14:27 2012
New Revision: 241902
URL: http://svn.freebsd.org/changeset/base/241902

Log:
  Optimize syntax to use builtins and reduce unnecessary forking where possible.
  
  Reviewed by:	nwhitehorn
  Approved by:	adrian (co-mentor)

Modified:
  head/usr.sbin/bsdinstall/bsdinstall
  head/usr.sbin/bsdinstall/scripts/auto

Modified: head/usr.sbin/bsdinstall/bsdinstall
==============================================================================
--- head/usr.sbin/bsdinstall/bsdinstall	Mon Oct 22 18:05:01 2012	(r241901)
+++ head/usr.sbin/bsdinstall/bsdinstall	Mon Oct 22 18:14:27 2012	(r241902)
@@ -32,12 +32,8 @@
 : ${BSDINSTALL_DISTDIR="/usr/freebsd-dist"}; export BSDINSTALL_DISTDIR
 : ${BSDINSTALL_CHROOT="/mnt"}; export BSDINSTALL_CHROOT
 
-VERB=$1; shift
+VERB=${1:-auto}; shift
 
-if [ -z "$VERB" ]; then
-	VERB=auto
-fi
-
-test -d "$BSDINSTALL_TMPETC" || mkdir "$BSDINSTALL_TMPETC"
+[ -d "$BSDINSTALL_TMPETC" ] || mkdir -p "$BSDINSTALL_TMPETC"
 echo "Running installation step: $VERB $@" >> "$BSDINSTALL_LOG"
-exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>>"$BSDINSTALL_LOG"
+exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>> "$BSDINSTALL_LOG"

Modified: head/usr.sbin/bsdinstall/scripts/auto
==============================================================================
--- head/usr.sbin/bsdinstall/scripts/auto	Mon Oct 22 18:05:01 2012	(r241901)
+++ head/usr.sbin/bsdinstall/scripts/auto	Mon Oct 22 18:14:27 2012	(r241902)
@@ -53,15 +53,15 @@ bsdinstall hostname || error
 
 export DISTRIBUTIONS="base.txz kernel.txz"
 if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then
-	DISTMENU=`cut -f 4,5,6 $BSDINSTALL_DISTDIR/MANIFEST | grep -v -e ^kernel -e ^base`
+	DISTMENU=`awk '!/^(kernel|base)/{print $4,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST`
 
 	exec 3>&1
-	EXTRA_DISTS=$(echo $DISTMENU | xargs dialog \
-	    --backtitle "FreeBSD Installer" \
-	    --title "Distribution Select" --nocancel --separate-output \
-	    --checklist "Choose optional system components to install:" \
-	    0 0 0 \
-	2>&1 1>&3)
+	EXTRA_DISTS=$( eval dialog \
+	    --backtitle \"FreeBSD Installer\" \
+	    --title \"Distribution Select\" --nocancel --separate-output \
+	    --checklist \"Choose optional system components to install:\" \
+	    0 0 0 $DISTMENU \
+	2>&1 1>&3 )
 	for dist in $EXTRA_DISTS; do
 		export DISTRIBUTIONS="$DISTRIBUTIONS $dist.txz"
 	done



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210221814.q9MIERFb068467>