Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jul 2022 00:53:38 +0100
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        "Alfonso S. Siciliano" <asiciliano@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: 6833ac673d98 - main - bsdinstall netconfig: Replace dialog(1) with bsddialog(1)
Message-ID:  <A1B9F8E8-0F6D-49FF-9BD9-33EBACD01EA7@freebsd.org>
In-Reply-To: <202204022134.232LY93T053253@gitrepo.freebsd.org>
References:  <202204022134.232LY93T053253@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2 Apr 2022, at 22:34, Alfonso S. Siciliano <asiciliano@FreeBSD.org> =
wrote:
>=20
> The branch main has been updated by asiciliano:
>=20
> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3D6833ac673d98275ef72a887337271401=
1c73eb15
>=20
> commit 6833ac673d98275ef72a8873372714011c73eb15
> Author:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
> AuthorDate: 2022-04-02 19:29:37 +0000
> Commit:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
> CommitDate: 2022-04-02 19:33:40 +0000
>=20
>    bsdinstall netconfig: Replace dialog(1) with bsddialog(1)
>=20
>    Replace (LGPL) dialog(1) with (BSD-2-Clause) bsddialog(1).
>=20
>    Approved by:            bapt (mentor)
>    Differential Revision:  https://reviews.freebsd.org/D34682
> ---
> usr.sbin/bsdinstall/scripts/netconfig | 62 =
+++++++++++++++++------------------
> 1 file changed, 31 insertions(+), 31 deletions(-)
>=20
> diff --git a/usr.sbin/bsdinstall/scripts/netconfig =
b/usr.sbin/bsdinstall/scripts/netconfig
> index f9913c324228..11ee646c403d 100755
> --- a/usr.sbin/bsdinstall/scripts/netconfig
> +++ b/usr.sbin/bsdinstall/scripts/netconfig
> @@ -32,14 +32,14 @@
> # $FreeBSD$
>=20
> INTERFACES=3D""
> -DIALOG_TAGS=3D""
> +BSDDIALOG_ITEMS=3D""
>=20
> -: ${DIALOG_OK=3D0}
> -: ${DIALOG_CANCEL=3D1}
> -: ${DIALOG_HELP=3D2}
> -: ${DIALOG_EXTRA=3D3}
> -: ${DIALOG_ITEM_HELP=3D4}
> -: ${DIALOG_ESC=3D255}
> +: ${BSDDIALOG_OK=3D0}
> +: ${BSDDIALOG_CANCEL=3D1}
> +: ${BSDDIALOG_HELP=3D2}
> +: ${BSDDIALOG_EXTRA=3D3}
> +: ${BSDDIALOG_ESC=3D5}
> +: ${BSDDIALOG_ERROR=3D255}
>=20
> for IF in `ifconfig -l`; do
> 	test "$IF" =3D "lo0" && continue
> @@ -59,19 +59,19 @@ is_wireless_if() {
>=20
> for IF in $INTERFACES; do
> 	DESC=3D`sysctl -n dev.$(echo $IF | sed -E =
's/([[:alpha:]]*)([[:digit:]]*)/\1.\2/g').%desc`
> -	DIALOG_TAGS=3D"$DIALOG_TAGS $IF \"$DESC\""
> +	BSDDIALOG_ITEMS=3D"$BSDDIALOG_ITEMS $IF \"$DESC\""
> done
>=20
> if [ -z "$INTERFACES" ]; then
> -	dialog --backtitle 'FreeBSD Installer' \
> +	bsddialog --backtitle 'FreeBSD Installer' \
> 	    --title 'Network Configuration Error' \
> 	    --msgbox 'No network interfaces present to configure.' 0 0
> 	exit 1
> fi
>=20
> exec 3>&1
> -INTERFACE=3D`echo $DIALOG_TAGS | xargs dialog --backtitle 'FreeBSD =
Installer' --title 'Network Configuration' --menu 'Please select a =
network interface to configure:' 0 0 0 2>&1 1>&3`
> -if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
> +INTERFACE=3D`echo $BSDDIALOG_ITEMS | xargs -o bsddialog --backtitle =
'FreeBSD Installer' --title 'Network Configuration' --menu 'Please =
select a network interface to configure:' 0 0 0 2>&1 1>&3`
> +if [ $? -eq $BSDDIALOG_CANCEL ]; then exit 1; fi
> exec 3>&-
>=20
> : > $BSDINSTALL_TMPETC/._rc.conf.net
> @@ -101,9 +101,9 @@ case $? in
> esac
>=20
> if [ ${IPV4_AVAIL} -eq 1 ]; then
> -	dialog --backtitle 'FreeBSD Installer' --title 'Network =
Configuration' \
> +	bsddialog --backtitle 'FreeBSD Installer' --title 'Network =
Configuration' \
> 	    --yesno 'Would you like to configure IPv4 for this =
interface?' 0 0
> -	if [ $? -eq $DIALOG_OK ]; then
> +	if [ $? -eq $BSDDIALOG_OK ]; then
> 		bsdinstall netconfig_ipv4 ${INTERFACE} =
"${IFCONFIG_PREFIX}" || \
> 		exec $0
> 	else
> @@ -116,9 +116,9 @@ if [ ${IPV4_AVAIL} -eq 0 -a -n ${IFCONFIG_PREFIX} =
]; then
> 	echo ifconfig_${INTERFACE}=3D\"${IFCONFIG_PREFIX}\" >> =
$BSDINSTALL_TMPETC/._rc.conf.net
> fi
> if [ ${IPV6_AVAIL} -eq 1 ]; then
> -	dialog --backtitle 'FreeBSD Installer' --title 'Network =
Configuration' \
> +	bsddialog --backtitle 'FreeBSD Installer' --title 'Network =
Configuration' \
> 	    --yesno 'Would you like to configure IPv6 for this =
interface?' 0 0
> -	if [ $? -eq $DIALOG_OK ]; then
> +	if [ $? -eq $BSDDIALOG_OK ]; then
> 		bsdinstall netconfig_ipv6 ${INTERFACE} || exec $0
> 	else
> 		IPV6_AVAIL=3D0
> @@ -158,34 +158,34 @@ done < ${BSDINSTALL_TMPETC}/resolv.conf
> RESOLV=3D""
> if [ ${IPV6_AVAIL} -eq 1 -a ${IPV4_AVAIL} -eq 1 ];  then
> 	RESOLV=3D"
> -	    'Search' 1 0 \"${SEARCH}\" 1 16 50 0 0
> -	    'Nameserver' 2 0 \"Nameserver\" 2 16 50 0 2
> -	    'IPv6 DNS #1' 2 0 \"${IP6_1}\" 2 16 50 0 0
> -	    'IPv6 DNS #2' 3 0 \"${IP6_2}\" 3 16 50 0 0
> -	    'IPv4 DNS #1' 4 0 \"${IP4_1}\" 4 16 16 0 0
> -	    'IPv4 DNS #2' 5 0 \"${IP4_2}\" 5 16 16 0 0"
> +	    'Search' 1 1 \"${SEARCH}\" 1 16 50 50 0
> +	    'Nameserver' 2 1 \"Nameserver\" 2 1 11 11 2
> +	    'IPv6 DNS #1' 2 1 \"${IP6_1}\" 2 16 50 50 0
> +	    'IPv6 DNS #2' 3 1 \"${IP6_2}\" 3 16 50 50 0
> +	    'IPv4 DNS #1' 4 1 \"${IP4_1}\" 4 16 16 16 0
> +	    'IPv4 DNS #2' 5 1 \"${IP4_2}\" 5 16 16 16 0"
> elif [ ${IPV6_AVAIL} -eq 1 ]; then
> 	RESOLV=3D"
> -	    'Search' 1 0 \"${SEARCH}\" 1 16 50 0 0
> -	    'Nameserver' 2 0 \"Nameserver\" 2 16 50 0 2
> -	    'IPv6 DNS #1' 2 0 \"${IP6_1}\" 2 16 50 0 0
> -	    'IPv6 DNS #2' 3 0 \"${IP6_2}\" 3 16 50 0 0"
> +	    'Search' 1 1 \"${SEARCH}\" 1 16 50 50 0
> +	    'Nameserver' 2 1 \"Nameserver\" 2 1 11 11 2
> +	    'IPv6 DNS #1' 2 1 \"${IP6_1}\" 2 16 50 50 0
> +	    'IPv6 DNS #2' 3 1 \"${IP6_2}\" 3 16 50 50 0"
> elif [ ${IPV4_AVAIL} -eq 1 ]; then
> 	RESOLV=3D"
> -	    'Search' 1 0 \"${SEARCH}\" 1 16 50 0 0
> -	    'Nameserver' 2 0 \"Nameserver\" 2 16 50 0 2
> -	    'IPv4 DNS #1' 2 0 \"${IP4_1}\" 2 16 16 0 0
> -	    'IPv4 DNS #2' 3 0 \"${IP4_2}\" 3 16 16 0 0"
> +	    'Search' 1 1 \"${SEARCH}\" 1 16 50 50 0
> +	    'Nameserver' 2 1 \"Nameserver\" 2 1 11 11 2
> +	    'IPv4 DNS #1' 2 1 \"${IP4_1}\" 2 16 16 16 0
> +	    'IPv4 DNS #2' 3 1 \"${IP4_2}\" 3 16 16 16 0"
> else
> 	exit 0
> fi
>=20
> exec 3>&1
> -RESOLV=3D$(echo "${RESOLV}" | xargs dialog --backtitle 'FreeBSD =
Installer' \
> +RESOLV=3D$(echo "${RESOLV}" | xargs -o bsddialog --backtitle 'FreeBSD =
Installer' \
> 	--title 'Network Configuration' \
> 	--mixedform 'Resolver Configuration' 0 0 0 \

Not having the --hline "Use TAB and Enter to select OK" for this like
hostname makes it rather confusing as to why pressing Enter on this
screen no longer works.

Jess

> 2>&1 1>&3)
> -if [ $? -eq $DIALOG_CANCEL ]; then exec $0; fi
> +if [ $? -eq $BSDDIALOG_CANCEL ]; then exec $0; fi
> exec 3>&-
>=20
> echo ${RESOLV} | tr ' ' '\n' | \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A1B9F8E8-0F6D-49FF-9BD9-33EBACD01EA7>