Re: git: 0e5c72c3cc54 - main - bsdinstall time: Replace dialog with bsddialog

From: Jessica Clarke <jrtc27_at_freebsd.org>
Date: Thu, 14 Jul 2022 00:06:56 UTC
On 23 Mar 2022, at 15:57, Alfonso S. Siciliano <asiciliano@FreeBSD.org> wrote:
> 
> The branch main has been updated by asiciliano:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=0e5c72c3cc5471dfa8cb42b018d623b1ef15dbe8
> 
> commit 0e5c72c3cc5471dfa8cb42b018d623b1ef15dbe8
> Author:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
> AuthorDate: 2022-03-23 15:52:39 +0000
> Commit:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
> CommitDate: 2022-03-23 15:56:37 +0000
> 
>    bsdinstall time: Replace dialog with bsddialog
> 
>    Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility,
>    'dialog --calendar' is replaced by 'bsddialog --datebox' with same
>    features but different User Interface.
> 
>    Approved by:            bapt (mentor)
>    Differential Revision:  https://reviews.freebsd.org/D34583
> ---
> usr.sbin/bsdinstall/scripts/time | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/usr.sbin/bsdinstall/scripts/time b/usr.sbin/bsdinstall/scripts/time
> index cccd5999a035..5db4b48f7531 100755
> --- a/usr.sbin/bsdinstall/scripts/time
> +++ b/usr.sbin/bsdinstall/scripts/time
> @@ -36,23 +36,23 @@ export TZ
> 
> # Set date
> exec 3>&1
> -DATE=$(dialog --backtitle 'FreeBSD Installer' \
> -	--title 'Time & Date' \
> +DATE=$(bsddialog --backtitle 'FreeBSD Installer' \
> +	--title ' Date ' \
> 	--ok-label 'Set Date' \
> 	--cancel-label 'Skip' \
> -	--defaultno \
> +	--default-no \
> 	--date-format '%Y%m%d%H%M.%S' \
> -	--calendar '' 0 40 \
> +	--datebox '' 0 40 \
> 2>&1 1>&3) && date $DATE
> exec 3>&-
> 
> # Set time
> exec 3>&1
> -TIME=$(dialog --backtitle 'FreeBSD Installer' \
> -	--title 'Time & Date' \
> +TIME=$(bsddialog --backtitle 'FreeBSD Installer' \
> +	--title ' Time ' \
> 	--ok-label 'Set Time' \
> 	--cancel-label 'Skip' \
> -	--defaultno \
> +	--default-no \
> 	--time-format '%H%M.%S' \
> 	--timebox '' 0 40 \
> 2>&1 1>&3) && date $TIME

Something I missed until trying out an image post this commit:
bsddialog’s --timebox implementation does not zero-pad the numbers, so
you end up with nonsense like 1:2:3 rather than 01:02:03 (or 1:02:03,
but 01:02:03 generally looks better).

Having the date displayed as YYYY/monthname/DD for --datebox is also a
bit strange, but I can see reasons for doing that I guess.

Jess