summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2014-11-19 01:07:58 +0000
committersjg <sjg@FreeBSD.org>2014-11-19 01:07:58 +0000
commitb137080f19736ee33fede2e88bb54438604cf86b (patch)
tree377ac0ac449528621eb192cd245adadb5fd53668 /usr.sbin/bsdconfig
parentab21a29eb607d4dfe389b965fbdee27558e791aa (diff)
parent4a8d07956d121238d006d34ffe7d6269744e8b1a (diff)
downloadFreeBSD-src-b137080f19736ee33fede2e88bb54438604cf86b.zip
FreeBSD-src-b137080f19736ee33fede2e88bb54438604cf86b.tar.gz
Merge from head@274682
Diffstat (limited to 'usr.sbin/bsdconfig')
-rw-r--r--usr.sbin/bsdconfig/Makefile5
-rw-r--r--usr.sbin/bsdconfig/bsdconfig.811
-rw-r--r--usr.sbin/bsdconfig/console/Makefile3
-rw-r--r--usr.sbin/bsdconfig/console/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/diskmgmt/Makefile3
-rw-r--r--usr.sbin/bsdconfig/diskmgmt/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/docsinstall/Makefile3
-rw-r--r--usr.sbin/bsdconfig/docsinstall/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/dot/Makefile3
-rw-r--r--usr.sbin/bsdconfig/dot/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/examples/Makefile3
-rw-r--r--usr.sbin/bsdconfig/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/includes/Makefile3
-rw-r--r--usr.sbin/bsdconfig/includes/include/Makefile3
-rwxr-xr-xusr.sbin/bsdconfig/includes/includes8
-rw-r--r--usr.sbin/bsdconfig/mouse/Makefile3
-rw-r--r--usr.sbin/bsdconfig/mouse/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/networking/Makefile3
-rw-r--r--usr.sbin/bsdconfig/networking/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/networking/share/Makefile3
-rw-r--r--usr.sbin/bsdconfig/networking/share/device.subr2
-rw-r--r--usr.sbin/bsdconfig/packages/Makefile3
-rw-r--r--usr.sbin/bsdconfig/packages/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/password/Makefile3
-rw-r--r--usr.sbin/bsdconfig/password/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/password/share/Makefile3
-rw-r--r--usr.sbin/bsdconfig/security/Makefile3
-rw-r--r--usr.sbin/bsdconfig/security/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/share/Makefile3
-rw-r--r--usr.sbin/bsdconfig/share/common.subr36
-rw-r--r--usr.sbin/bsdconfig/share/device.subr5
-rw-r--r--usr.sbin/bsdconfig/share/dialog.subr26
-rw-r--r--usr.sbin/bsdconfig/share/media/Makefile3
-rw-r--r--usr.sbin/bsdconfig/share/packages/Makefile3
-rw-r--r--usr.sbin/bsdconfig/share/packages/index.subr8
-rw-r--r--usr.sbin/bsdconfig/share/packages/packages.subr6
-rw-r--r--usr.sbin/bsdconfig/startup/Makefile3
-rw-r--r--usr.sbin/bsdconfig/startup/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/startup/share/Makefile3
-rw-r--r--usr.sbin/bsdconfig/timezone/Makefile3
-rw-r--r--usr.sbin/bsdconfig/timezone/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/timezone/share/Makefile3
-rwxr-xr-xusr.sbin/bsdconfig/timezone/timezone5
-rw-r--r--usr.sbin/bsdconfig/ttys/Makefile3
-rw-r--r--usr.sbin/bsdconfig/ttys/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/usermgmt/Makefile3
-rw-r--r--usr.sbin/bsdconfig/usermgmt/include/Makefile3
-rw-r--r--usr.sbin/bsdconfig/usermgmt/share/Makefile3
48 files changed, 87 insertions, 139 deletions
diff --git a/usr.sbin/bsdconfig/Makefile b/usr.sbin/bsdconfig/Makefile
index 72187de..1f1ec9e 100644
--- a/usr.sbin/bsdconfig/Makefile
+++ b/usr.sbin/bsdconfig/Makefile
@@ -25,9 +25,4 @@ SCRIPTS= bsdconfig
MAN= bsdconfig.8
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
- mkdir -p ${DESTDIR}${SCRIPTSDIR}
- mkdir -p ${DESTDIR}${MANDIR}8
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/bsdconfig.8 b/usr.sbin/bsdconfig/bsdconfig.8
index 3f25c95c..849f85b 100644
--- a/usr.sbin/bsdconfig/bsdconfig.8
+++ b/usr.sbin/bsdconfig/bsdconfig.8
@@ -172,16 +172,27 @@ Shortcut to the Delete menu under the View/Edit Startup Configuration menu
(startup_rcconf) of startup.
.It Cm startup_rcvar
Shortcut to the Toggle Startup Services menu under startup.
+.\" use neutral name, e.g. console_keymap instead of syscons_keymap?
+.\" font (encoding) selection not applicable to vt(4)!
.It Cm syscons_font
Shortcut to the Font menu under console.
+.\" .It Cm console_keymap
+.\" Shortcut to the Keymap menu under console.
.It Cm syscons_keymap
Shortcut to the Keymap menu under console.
+.\" .It Cm vt_repeat
+.\" Shortcut to the Repeat menu under console.
.It Cm syscons_repeat
Shortcut to the Repeat menu under console.
+.\" .It Cm vt_saver
+.\" Shortcut to the Saver menu under console.
.It Cm syscons_saver
Shortcut to the Saver menu under console.
+.\" screenmap (encoding) selection not applicable to vt(4)!
.It Cm syscons_screenmap
Shortcut to the Screenmap menu under console.
+.\" .It Cm vt_syscons_ttys
+.\" Shortcut to the Ttys menu under console.
.It Cm syscons_ttys
Shortcut to the Ttys menu under console.
.It Cm timezone
diff --git a/usr.sbin/bsdconfig/console/Makefile b/usr.sbin/bsdconfig/console/Makefile
index aa6c6f1..c765a33 100644
--- a/usr.sbin/bsdconfig/console/Makefile
+++ b/usr.sbin/bsdconfig/console/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= console font keymap repeat saver screenmap ttys
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/console/include/Makefile b/usr.sbin/bsdconfig/console/include/Makefile
index e915751..d2a17a0 100644
--- a/usr.sbin/bsdconfig/console/include/Makefile
+++ b/usr.sbin/bsdconfig/console/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/080.console/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/diskmgmt/Makefile b/usr.sbin/bsdconfig/diskmgmt/Makefile
index 894c62c..fc659f8 100644
--- a/usr.sbin/bsdconfig/diskmgmt/Makefile
+++ b/usr.sbin/bsdconfig/diskmgmt/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= diskmgmt
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/diskmgmt/include/Makefile b/usr.sbin/bsdconfig/diskmgmt/include/Makefile
index 9c94c0e..33b93e0 100644
--- a/usr.sbin/bsdconfig/diskmgmt/include/Makefile
+++ b/usr.sbin/bsdconfig/diskmgmt/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/050.diskmgmt/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/docsinstall/Makefile b/usr.sbin/bsdconfig/docsinstall/Makefile
index de03d7d..4b67834 100644
--- a/usr.sbin/bsdconfig/docsinstall/Makefile
+++ b/usr.sbin/bsdconfig/docsinstall/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= docsinstall
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/docsinstall/include/Makefile b/usr.sbin/bsdconfig/docsinstall/include/Makefile
index 9f75f7d..b86091a 100644
--- a/usr.sbin/bsdconfig/docsinstall/include/Makefile
+++ b/usr.sbin/bsdconfig/docsinstall/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/020.docsinstall/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/dot/Makefile b/usr.sbin/bsdconfig/dot/Makefile
index 5a87282..0f11518 100644
--- a/usr.sbin/bsdconfig/dot/Makefile
+++ b/usr.sbin/bsdconfig/dot/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= dot
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/dot/include/Makefile b/usr.sbin/bsdconfig/dot/include/Makefile
index 9bbdea0..891279f 100644
--- a/usr.sbin/bsdconfig/dot/include/Makefile
+++ b/usr.sbin/bsdconfig/dot/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/dot/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/examples/Makefile b/usr.sbin/bsdconfig/examples/Makefile
index 156ccaf..33899d8 100644
--- a/usr.sbin/bsdconfig/examples/Makefile
+++ b/usr.sbin/bsdconfig/examples/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${SHAREDIR}/examples/bsdconfig
FILES= add_some_packages.sh browse_packages_http.sh bsdconfigrc
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/include/Makefile b/usr.sbin/bsdconfig/include/Makefile
index ee21cec..50bef4c 100644
--- a/usr.sbin/bsdconfig/include/Makefile
+++ b/usr.sbin/bsdconfig/include/Makefile
@@ -6,7 +6,4 @@ FILESDIR= ${LIBEXECDIR}/bsdconfig/include
FILES= bsdconfig.hlp media.hlp messages.subr network_device.hlp \
options.hlp tcp.hlp usage.hlp
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/includes/Makefile b/usr.sbin/bsdconfig/includes/Makefile
index f7cbc1e..4717d34 100644
--- a/usr.sbin/bsdconfig/includes/Makefile
+++ b/usr.sbin/bsdconfig/includes/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= includes
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/includes/include/Makefile b/usr.sbin/bsdconfig/includes/include/Makefile
index 79c4481..21d55a1 100644
--- a/usr.sbin/bsdconfig/includes/include/Makefile
+++ b/usr.sbin/bsdconfig/includes/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/includes/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/includes/includes b/usr.sbin/bsdconfig/includes/includes
index d831649..6e9906f 100755
--- a/usr.sbin/bsdconfig/includes/includes
+++ b/usr.sbin/bsdconfig/includes/includes
@@ -69,10 +69,12 @@ show_include()
-v use_color=${USE_COLOR:-0} \
-v re="$pattern" \
-v show_desc=${SHOW_DESC:-0} '
- function asorti(src, dest)
+ function _asorti(src, dest)
{
+ k = nitems = 0;
+
# Copy src indices to dest and calculate array length
- nitems = 0; for (i in src) dest[++nitems] = i
+ for (i in src) dest[++nitems] = i
# Sort the array of indices (dest) using insertion sort method
for (i = 1; i <= nitems; k = i++)
@@ -118,7 +120,7 @@ show_include()
}
}
END {
- n = asorti(syntax, sorted_indices)
+ n = _asorti(syntax, sorted_indices)
for (i = 1; i <= n; i++)
printf "%s", syntax[sorted_indices[i]]
}' "$file" )
diff --git a/usr.sbin/bsdconfig/mouse/Makefile b/usr.sbin/bsdconfig/mouse/Makefile
index 3b68cad..b054c8b 100644
--- a/usr.sbin/bsdconfig/mouse/Makefile
+++ b/usr.sbin/bsdconfig/mouse/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= disable enable flags mouse port type
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/mouse/include/Makefile b/usr.sbin/bsdconfig/mouse/include/Makefile
index ed0b24d..5071db8 100644
--- a/usr.sbin/bsdconfig/mouse/include/Makefile
+++ b/usr.sbin/bsdconfig/mouse/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/110.mouse/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/networking/Makefile b/usr.sbin/bsdconfig/networking/Makefile
index 4b7d528..fcd8421 100644
--- a/usr.sbin/bsdconfig/networking/Makefile
+++ b/usr.sbin/bsdconfig/networking/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= defaultrouter devices hostname nameservers networking
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/networking/include/Makefile b/usr.sbin/bsdconfig/networking/include/Makefile
index c93d486..b76349a 100644
--- a/usr.sbin/bsdconfig/networking/include/Makefile
+++ b/usr.sbin/bsdconfig/networking/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/120.networking/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/networking/share/Makefile b/usr.sbin/bsdconfig/networking/share/Makefile
index cf1119d..3cb2d4e 100644
--- a/usr.sbin/bsdconfig/networking/share/Makefile
+++ b/usr.sbin/bsdconfig/networking/share/Makefile
@@ -6,7 +6,4 @@ FILESDIR= ${SHAREDIR}/bsdconfig/networking
FILES= common.subr device.subr hostname.subr ipaddr.subr media.subr \
netmask.subr resolv.subr routing.subr services.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/networking/share/device.subr b/usr.sbin/bsdconfig/networking/share/device.subr
index 42010ab..bb41be3 100644
--- a/usr.sbin/bsdconfig/networking/share/device.subr
+++ b/usr.sbin/bsdconfig/networking/share/device.subr
@@ -82,7 +82,7 @@ f_dialog_menu_netdev()
f_struct "$dev" get name if || continue
# Skip unsavory interfaces
case "$if" in
- lo[0-9]*|ppp[0-9]*|sl[0-9]*|faith[0-9]*) continue ;;
+ lo[0-9]*|ppp[0-9]*|sl[0-9]*) continue ;;
esac
iflist="$iflist $if"
done
diff --git a/usr.sbin/bsdconfig/packages/Makefile b/usr.sbin/bsdconfig/packages/Makefile
index fd96757..6450e06 100644
--- a/usr.sbin/bsdconfig/packages/Makefile
+++ b/usr.sbin/bsdconfig/packages/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= packages
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/packages/include/Makefile b/usr.sbin/bsdconfig/packages/include/Makefile
index ed2a1f3..0c72bd4 100644
--- a/usr.sbin/bsdconfig/packages/include/Makefile
+++ b/usr.sbin/bsdconfig/packages/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/030.packages/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/password/Makefile b/usr.sbin/bsdconfig/password/Makefile
index 7330c31..0c4851f 100644
--- a/usr.sbin/bsdconfig/password/Makefile
+++ b/usr.sbin/bsdconfig/password/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= password
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/password/include/Makefile b/usr.sbin/bsdconfig/password/include/Makefile
index 27ad607..dba8f19 100644
--- a/usr.sbin/bsdconfig/password/include/Makefile
+++ b/usr.sbin/bsdconfig/password/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/040.password/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/password/share/Makefile b/usr.sbin/bsdconfig/password/share/Makefile
index ceba510..af707b3 100644
--- a/usr.sbin/bsdconfig/password/share/Makefile
+++ b/usr.sbin/bsdconfig/password/share/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${SHAREDIR}/bsdconfig/password
FILES= password.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/security/Makefile b/usr.sbin/bsdconfig/security/Makefile
index c230973..4caa6ae 100644
--- a/usr.sbin/bsdconfig/security/Makefile
+++ b/usr.sbin/bsdconfig/security/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= kern_securelevel security
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/security/include/Makefile b/usr.sbin/bsdconfig/security/include/Makefile
index a94c127..8b49a81 100644
--- a/usr.sbin/bsdconfig/security/include/Makefile
+++ b/usr.sbin/bsdconfig/security/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/130.security/include
FILES= messages.subr securelevel.hlp
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/share/Makefile b/usr.sbin/bsdconfig/share/Makefile
index 5b81af4..400cc11 100644
--- a/usr.sbin/bsdconfig/share/Makefile
+++ b/usr.sbin/bsdconfig/share/Makefile
@@ -9,7 +9,4 @@ FILES= common.subr device.subr dialog.subr geom.subr keymap.subr \
mustberoot.subr script.subr strings.subr struct.subr \
sysrc.subr variable.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr
index 8fb9adaa..b7f4ee7 100644
--- a/usr.sbin/bsdconfig/share/common.subr
+++ b/usr.sbin/bsdconfig/share/common.subr
@@ -220,6 +220,36 @@ f_have()
f_quietly type "$@"
}
+# setvar $var_to_set [$value]
+#
+# Implement setvar for shells unlike FreeBSD sh(1).
+#
+if ! f_have setvar; then
+setvar()
+{
+ [ $# -gt 0 ] || return $SUCCESS
+ local __setvar_var_to_set="$1" __setvar_right="$2" __setvar_left=
+ case $# in
+ 1) unset "$__setvar_var_to_set"
+ return $? ;;
+ 2) : fall through ;;
+ *) f_err "setvar: too many arguments\n"
+ return $FAILURE
+ esac
+ case "$__setvar_var_to_set" in *[!0-9A-Za-z_]*)
+ f_err "setvar: %s: bad variable name\n" "$__setvar_var_to_set"
+ return 2
+ esac
+ while case "$__setvar_r" in *\'*) : ;; *) false ; esac
+ do
+ __setvar_left="$__setvar_left${__setvar_right%%\'*}'\\''"
+ __setvar_right="${__setvar_right#*\'}"
+ done
+ __setvar_left="$__setvar_left${__setvar_right#*\'}"
+ eval "$__setvar_var_to_set='$__setvar_left'"
+}
+fi
+
# f_which $anything [$var_to_set]
#
# A fast built-in replacement for syntaxes such as foo=$( which bar ). In a
@@ -233,10 +263,10 @@ f_which()
{
local __name="$1" __var_to_set="$2"
case "$__name" in */*|'') return $FAILURE; esac
- local __p IFS=":" __found=
+ local __p __exec IFS=":" __found=
for __p in $PATH; do
- local __exec="$__p/$__name"
- [ -f "$__exec" -a -x "$__exec" ] && __found=1 && break
+ __exec="$__p/$__name"
+ [ -f "$__exec" -a -x "$__exec" ] && __found=1 break
done
if [ "$__found" ]; then
if [ "$__var_to_set" ]; then
diff --git a/usr.sbin/bsdconfig/share/device.subr b/usr.sbin/bsdconfig/share/device.subr
index d93cd9b..d95684d 100644
--- a/usr.sbin/bsdconfig/share/device.subr
+++ b/usr.sbin/bsdconfig/share/device.subr
@@ -1116,8 +1116,9 @@ f_device_shutdown()
f_device_sort_by_awk='
# Variables that should be defined on the invocation line:
# -v prop="property"
-function asorti(src, dest)
+function _asorti(src, dest)
{
+ k = nitems = 0
for (i in src) dest[++nitems] = i
for (i = 1; i <= nitems; k = i++) {
idx = dest[i]
@@ -1136,7 +1137,7 @@ function asorti(src, dest)
}
}
END {
- nitems = asorti(devices, devices_sorted)
+ nitems = _asorti(devices, devices_sorted)
for (i = 1; i <= nitems; i++) print devices[devices_sorted[i]]
}
'
diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr
index e0dfe80..db99a70 100644
--- a/usr.sbin/bsdconfig/share/dialog.subr
+++ b/usr.sbin/bsdconfig/share/dialog.subr
@@ -1557,12 +1557,22 @@ f_dialog_info()
# EOF. This implies that you must execute this either as an rvalue to a pipe,
# lvalue to indirection or in a sub-shell that provides data on stdin.
#
+# To open an Xdialog(1) infobox that does not disappear until expeclitly dis-
+# missed, use the following:
+#
+# f_xdialog_info "$info_text" < /dev/tty &
+# pid=$!
+# # Perform some lengthy actions
+# kill $pid
+#
+# NB: Check $USE_XDIALOG if you need to support both dialog(1) and Xdialog(1).
+#
f_xdialog_info()
{
local info_text="$*" height width
f_dialog_infobox_size height width \
"$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$info_text"
- $DIALOG \
+ exec $DIALOG \
--title "$DIALOG_TITLE" \
--backtitle "$DIALOG_BACKTITLE" \
--no-close --no-buttons \
@@ -2099,9 +2109,14 @@ f_dialog_init()
#
# Process stored command-line arguments
#
+ # NB: Using backticks instead of $(...) for portability since Linux
+ # bash(1) balks at the right parentheses encountered in the case-
+ # statement (incorrectly interpreting it as the close of $(...)).
+ #
f_dprintf "f_dialog_init: ARGV=[%s] GETOPTS_STDARGS=[%s]" \
"$ARGV" "$GETOPTS_STDARGS"
- SECURE=$( set -- $ARGV
+ SECURE=`set -- $ARGV
+ OPTIND=1
while getopts \
"$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \
flag > /dev/null; do
@@ -2109,8 +2124,9 @@ f_dialog_init()
S) echo 1 ;;
esac
done
- )
- USE_XDIALOG=$( set -- $ARGV
+ ` # END-BACKTICK
+ USE_XDIALOG=`set -- $ARGV
+ OPTIND=1
while getopts \
"$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS" \
flag > /dev/null; do
@@ -2118,7 +2134,7 @@ f_dialog_init()
S|X) echo 1 ;;
esac
done
- )
+ ` # END-BACKTICK
f_dprintf "f_dialog_init: SECURE=[%s] USE_XDIALOG=[%s]" \
"$SECURE" "$USE_XDIALOG"
diff --git a/usr.sbin/bsdconfig/share/media/Makefile b/usr.sbin/bsdconfig/share/media/Makefile
index 6436749..7be059b 100644
--- a/usr.sbin/bsdconfig/share/media/Makefile
+++ b/usr.sbin/bsdconfig/share/media/Makefile
@@ -7,7 +7,4 @@ FILES= any.subr cdrom.subr common.subr directory.subr dos.subr \
floppy.subr ftp.subr http.subr httpproxy.subr network.subr \
nfs.subr options.subr tcpip.subr ufs.subr usb.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/share/packages/Makefile b/usr.sbin/bsdconfig/share/packages/Makefile
index cb06b80..8146346 100644
--- a/usr.sbin/bsdconfig/share/packages/Makefile
+++ b/usr.sbin/bsdconfig/share/packages/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${SHAREDIR}/bsdconfig/packages
FILES= categories.subr index.subr musthavepkg.subr packages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/share/packages/index.subr b/usr.sbin/bsdconfig/share/packages/index.subr
index 35ef0da..f3c1713 100644
--- a/usr.sbin/bsdconfig/share/packages/index.subr
+++ b/usr.sbin/bsdconfig/share/packages/index.subr
@@ -241,10 +241,12 @@ f_index_read()
export msg_packages
eval "$( debug= f_getvar "$var_to_get" | awk -F'|' '
- function asorti(src, dest)
+ function _asorti(src, dest)
{
+ k = nitems = 0
+
# Copy src indices to dest and calculate array length
- nitems = 0; for (i in src) dest[++nitems] = i
+ for (i in src) dest[++nitems] = i
# Sort the array of indices (dest) using insertion sort method
for (i = 1; i <= nitems; k = i++)
@@ -290,7 +292,7 @@ f_index_read()
END {
print "_npkgs=" tpkgs # For convenience, total package count
- n = asorti(categories, categories_sorted)
+ n = _asorti(categories, categories_sorted)
# Produce package counts for each category
for (i = 1; i <= n; i++)
diff --git a/usr.sbin/bsdconfig/share/packages/packages.subr b/usr.sbin/bsdconfig/share/packages/packages.subr
index a041fb6..f3ec707 100644
--- a/usr.sbin/bsdconfig/share/packages/packages.subr
+++ b/usr.sbin/bsdconfig/share/packages/packages.subr
@@ -1029,9 +1029,11 @@ f_package_extract()
# Request the package be added via pkg-install(8)
if f_debugging; then
- f_eval_catch $funcname pkg 'pkg -d install -y "%s"' "$name"
+ f_eval_catch $funcname pkg \
+ 'pkg -d install -${depended:+A}y "%s"' "$name"
else
- f_eval_catch $funcname pkg 'pkg install -y "%s"' "$name"
+ f_eval_catch $funcname pkg \
+ 'pkg install -${depended:+A}y "%s"' "$name"
fi
if [ $? -ne $SUCCESS ]; then
$alert "$msg_pkg_install_apparently_did_not_like_the_package" \
diff --git a/usr.sbin/bsdconfig/startup/Makefile b/usr.sbin/bsdconfig/startup/Makefile
index 0bba510..afab7b1 100644
--- a/usr.sbin/bsdconfig/startup/Makefile
+++ b/usr.sbin/bsdconfig/startup/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= misc rcadd rcconf rcdelete rcedit rcvar startup
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/startup/include/Makefile b/usr.sbin/bsdconfig/startup/include/Makefile
index 1634314..40a6539 100644
--- a/usr.sbin/bsdconfig/startup/include/Makefile
+++ b/usr.sbin/bsdconfig/startup/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/140.startup/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/startup/share/Makefile b/usr.sbin/bsdconfig/startup/share/Makefile
index 01c7d03..221c38b 100644
--- a/usr.sbin/bsdconfig/startup/share/Makefile
+++ b/usr.sbin/bsdconfig/startup/share/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${SHAREDIR}/bsdconfig/startup
FILES= rcconf.subr rcedit.subr rcvar.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/timezone/Makefile b/usr.sbin/bsdconfig/timezone/Makefile
index b4ef0cb..ea6a6a6 100644
--- a/usr.sbin/bsdconfig/timezone/Makefile
+++ b/usr.sbin/bsdconfig/timezone/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= timezone
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/timezone/include/Makefile b/usr.sbin/bsdconfig/timezone/include/Makefile
index 887536e..82787e1 100644
--- a/usr.sbin/bsdconfig/timezone/include/Makefile
+++ b/usr.sbin/bsdconfig/timezone/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/090.timezone/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/timezone/share/Makefile b/usr.sbin/bsdconfig/timezone/share/Makefile
index 1b7b80c..bd67741 100644
--- a/usr.sbin/bsdconfig/timezone/share/Makefile
+++ b/usr.sbin/bsdconfig/timezone/share/Makefile
@@ -6,7 +6,4 @@ FILESDIR= ${SHAREDIR}/bsdconfig/timezone
FILES= continents.subr countries.subr iso3166.subr menus.subr \
zones.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/timezone/timezone b/usr.sbin/bsdconfig/timezone/timezone
index 0452230..66f2d78 100755
--- a/usr.sbin/bsdconfig/timezone/timezone
+++ b/usr.sbin/bsdconfig/timezone/timezone
@@ -62,7 +62,7 @@ _PATH_WALL_CMOS_CLOCK="/etc/wall_cmos_clock"
REALLYDOIT=1
REINSTALL=
USEDIALOG=1
-SKIPUTC=
+SKIPUTC= # See MAIN
VERBOSE=
TZ_OR_FAIL=
CHROOTENV=
@@ -119,6 +119,9 @@ dialog_menu_main()
############################################################ MAIN
+# Skip initial question regarding UTC v. Wall-Clock time if run in VM
+[ "$( sysctl -n kern.vm_guest 2> /dev/null )" = "none" ] || SKIPUTC=1
+
# Incorporate rc-file if it exists
[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"
diff --git a/usr.sbin/bsdconfig/ttys/Makefile b/usr.sbin/bsdconfig/ttys/Makefile
index b77bc24..d53314c 100644
--- a/usr.sbin/bsdconfig/ttys/Makefile
+++ b/usr.sbin/bsdconfig/ttys/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= ttys
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/ttys/include/Makefile b/usr.sbin/bsdconfig/ttys/include/Makefile
index 9333abe..2f32175 100644
--- a/usr.sbin/bsdconfig/ttys/include/Makefile
+++ b/usr.sbin/bsdconfig/ttys/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/150.ttys/include
FILES= messages.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/usermgmt/Makefile b/usr.sbin/bsdconfig/usermgmt/Makefile
index 5211c3c..d82f6d6 100644
--- a/usr.sbin/bsdconfig/usermgmt/Makefile
+++ b/usr.sbin/bsdconfig/usermgmt/Makefile
@@ -10,7 +10,4 @@ FILES= INDEX USAGE
SCRIPTSDIR= ${FILESDIR}
SCRIPTS= groupadd groupdel groupedit useradd userdel useredit usermgmt
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/usermgmt/include/Makefile b/usr.sbin/bsdconfig/usermgmt/include/Makefile
index 25d2a07..a63b1fe 100644
--- a/usr.sbin/bsdconfig/usermgmt/include/Makefile
+++ b/usr.sbin/bsdconfig/usermgmt/include/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${LIBEXECDIR}/bsdconfig/070.usermgmt/include
FILES= messages.subr usermgmt.hlp
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
diff --git a/usr.sbin/bsdconfig/usermgmt/share/Makefile b/usr.sbin/bsdconfig/usermgmt/share/Makefile
index 7f27c92..a13c200 100644
--- a/usr.sbin/bsdconfig/usermgmt/share/Makefile
+++ b/usr.sbin/bsdconfig/usermgmt/share/Makefile
@@ -5,7 +5,4 @@ NO_OBJ=
FILESDIR= ${SHAREDIR}/bsdconfig/usermgmt
FILES= group.subr group_input.subr user.subr user_input.subr
-beforeinstall:
- mkdir -p ${DESTDIR}${FILESDIR}
-
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud