summaryrefslogtreecommitdiff
path: root/distrib/miniroot/install.sub
diff options
context:
space:
mode:
Diffstat (limited to 'distrib/miniroot/install.sub')
-rw-r--r--distrib/miniroot/install.sub29
1 files changed, 24 insertions, 5 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 1fb551aac24..d678e9d0e89 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.451 2009/04/13 01:48:05 deraadt Exp $
+# $OpenBSD: install.sub,v 1.452 2009/04/13 01:59:19 deraadt Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2007 Todd Miller, Theo de Raadt, Ken Westerback
@@ -480,7 +480,8 @@ addhostent() {
#
# Set $resp to list of selected sets.
select_sets() {
- local _avail=$1 _selected=$2 _next _f _action
+ local _avail=$1 _selected=$2 _next _f _action _col _p
+ typeset -L16 _l # 16 characters per column
cat <<__EOT
@@ -491,15 +492,33 @@ __EOT
while :; do
_action=
_next=
- echo
+ _col=0
for _f in $_avail; do
if isin $_f $_selected; then
- echo " [X] $_f"
+ _p="[X] $_f"
else
- echo " [ ] $_f"
+ _p="[ ] $_f"
: ${_next:=$_f}
fi
+ if (( _col == 0 )); then
+ echo -n ' '
+ fi
+ if (( ${#_p} > 16 )); then
+ print -n "$_p" # XXX site* is last entry
+ _col=2 # trigger a new line
+ else
+ _l="$_p"
+ print -n "$_l"
+ fi
+ let _col=_col+1
+ if (( _col == 3 )); then
+ echo # end of a column
+ _col=0
+ fi
done
+ if (( _col % 3 )); then
+ echo # complete a partial column
+ fi
: ${_next:=done}
ask "Set name? (or 'done')" "$_next"