diff options
author | dteske <dteske@FreeBSD.org> | 2012-10-22 18:14:27 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2012-10-22 18:14:27 +0000 |
commit | b8c74d455d2690e710a0802a98a9d310995a52eb (patch) | |
tree | ee23b67fd25b371e96c8c4aa36b1c327a8ea7ab9 | |
parent | 83ab66c2117b8b182fe64b93994e6593c63a2c96 (diff) | |
download | FreeBSD-src-b8c74d455d2690e710a0802a98a9d310995a52eb.zip FreeBSD-src-b8c74d455d2690e710a0802a98a9d310995a52eb.tar.gz |
Optimize syntax to use builtins and reduce unnecessary forking where possible.
Reviewed by: nwhitehorn
Approved by: adrian (co-mentor)
-rwxr-xr-x | usr.sbin/bsdinstall/bsdinstall | 10 | ||||
-rwxr-xr-x | usr.sbin/bsdinstall/scripts/auto | 14 |
2 files changed, 10 insertions, 14 deletions
diff --git a/usr.sbin/bsdinstall/bsdinstall b/usr.sbin/bsdinstall/bsdinstall index 8225daf..2b55501 100755 --- a/usr.sbin/bsdinstall/bsdinstall +++ b/usr.sbin/bsdinstall/bsdinstall @@ -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" diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto index f6d1d37..356a215 100755 --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -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 |