Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 May 2022 16:02:51 -0700
From:      Devin Teske <dteske@freebsd.org>
To:        "Alfonso S. Siciliano" <alfix86@gmail.com>
Cc:        freebsd-arch@freebsd.org, dteske@freebsd.org
Subject:   Re: bsdinstall TUI utility
Message-ID:  <6D8C34A7-3219-4562-BA10-E6A96355A237@freebsd.org>
In-Reply-To: <7a4a099f-213b-b055-4c67-c4b89f7744fe@gmail.com>
References:  <7a4a099f-213b-b055-4c67-c4b89f7744fe@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_D33AF0BD-A25C-40EC-A4F1-2EC18FDE640D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On May 28, 2022, at 2:59 PM, Alfonso S. Siciliano <alfix86@gmail.com> =
wrote:
>=20
> Hello,
>=20
>=20
> So far I replaced and adapted `dialog` with `bsddialog` in
> bsdinstall/scripts.
> <https://wiki.freebsd.org/RoadmapFromDialogToBSDDialog>;
>=20
>=20
> Currently, I am addressing the last 4 scripts: auto, bootconfig, =
keymap,
> and wlanconfig. These scripts use also the $DIALOG variable and some
> "if" to handle Xdialog(1).
> For example 'auto' uses $DIALOG, $USE_XDIALOG, and `dialog`.
>=20

Can we simply add USE_GNU_DIALOG and switch USE_DIALOG to mean =
bsddialog?


> * $DIALOG: I seem bsdinstall(8) uses only dialog(1) as TUI utility.

bsdinstall(8) uses only dialog(1) in the context of $DIALOG

ASIDE: It also uses dialog(3) and dpv(3)/dpv(1)


> * I seem bsdconfig(8) does not "call" these 4 scripts, so, probably,
>  Xdialog(1) is not used in this context (that is `bsdconfig -X`).
>=20

Correct, bsdconfig does use bsdinstall


> Is there any objection to delete $DIALOG/LGPL-dialog/Xdialog to
> provide only the support for bsddialog(1) in bsdinstall(8)?
>=20

I object.

I and another developer are adding support for zenity

=
https://github.com/FrauBSD/pkgcenter/tree/bsdconfig/zenity/depend/bsdconfi=
g =
<https://github.com/FrauBSD/pkgcenter/tree/bsdconfig/zenity/depend/bsdconf=
ig>

There is also work to resolve the namespace issues in bsdinstall

=
https://github.com/FrauBSD/pkgcenter/tree/bsdinstall/namespace/depend/bsdc=
onfig =
<https://github.com/FrauBSD/pkgcenter/tree/bsdinstall/namespace/depend/bsd=
config>

I am in favor of keeping $DIALOG/LGPL-dialog/Xdialog support where it =
exists until those efforts can be completed.

ASIDE: bsdinstall doesn=E2=80=99t use Xdialog


> I would prefer this solution because I can avoid: to handle some
> dialog/Xdialog/bsddialog command line difference and to hook some
> bsdconfig function built on dialog(1) incompatible with bsddialog(1)
> (for example autosizing, implemented in bsddialog(3) already).
>=20

The differences in command line should be handled through conditionals, =
but can be the default and opt to handle LGPL-dialog through a =
USE_GNU_DIALOG flag

bsddialog may support auto-sizing, but so does dialog and Xdialog.

However, ...

The sizing code in bsdconfig (used indirectly by bsdinstall) was written =
because the auto-sizing that does exist and is available in both dialog =
and Xdialog (as well as Zenity) does not provide a cohesive experience =
when trying to write a program that is in-reality a series of bespoke =
dialogs.

The sizing code makes sure that regardless of which utility you are =
using that the experience is uniform in what is presented to the user.

Attempting to rely solely on the auto-sizing available from these =
separate utilities (including bsddialog) would change the UI/UX.

The problem was solved by:

1. Making the stored text used for dialogs dictate how it will look
2. Painstakingly determining where each utility failed given the text
3. Determining how to make the utility display the text properly

For example, stored text will contain newlines instead of attempting to =
rely on line wrapping on a box of given size.

I would have to evaluate bsddialog=E2=80=99s auto-sizing to determine if =
it is trust-worthy given not only all the stored texts, but all the =
translations as well (as bsdconfig is i18n compatible). It is actually =
less work to just allow bsdconfig to likely treat bsddialog as it is =
dialog and let it perform the size calculations for you.

If bsddialog is top be a drop-in replacement, I=E2=80=99m more than a =
little surprised that it cannot accept the sizes calculated for dialog =
being passed to it.


>=20
> Please note these considerations are only for bsdinstall, bsdconfig is
> unchanged.
>=20

What of dpv? bsdinstall uses dpv(3) to unpack the dists which in-turn =
relies on dlg_gauge_reallocate(3) from LGPL-dialog?
=E2=80=94=20
Devin=

--Apple-Mail=_D33AF0BD-A25C-40EC-A4F1-2EC18FDE640D
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On May 28, 2022, at 2:59 PM, Alfonso S. Siciliano &lt;<a =
href=3D"mailto:alfix86@gmail.com" class=3D"">alfix86@gmail.com</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div =
class=3D"">Hello,<br class=3D""><br class=3D""><br class=3D"">So far I =
replaced and adapted `dialog` with `bsddialog` in<br =
class=3D"">bsdinstall/scripts.<br class=3D"">&lt;<a =
href=3D"https://wiki.freebsd.org/RoadmapFromDialogToBSDDialog" =
class=3D"">https://wiki.freebsd.org/RoadmapFromDialogToBSDDialog</a>&gt;<b=
r class=3D""><br class=3D""><br class=3D"">Currently, I am addressing =
the last 4 scripts: auto, bootconfig, keymap,<br class=3D"">and =
wlanconfig. These scripts use also the $DIALOG variable and some<br =
class=3D"">"if" to handle Xdialog(1).<br class=3D"">For example 'auto' =
uses $DIALOG, $USE_XDIALOG, and `dialog`.<br class=3D""><br =
class=3D""></div></div></blockquote><div><br class=3D""></div><div>Can =
we simply add USE_GNU_DIALOG and switch USE_DIALOG to mean =
bsddialog?</div><div><br class=3D""></div><br class=3D""><blockquote =
type=3D"cite" class=3D""><div class=3D""><div class=3D"">* $DIALOG: I =
seem bsdinstall(8) uses only dialog(1) as TUI utility.<br =
class=3D""></div></div></blockquote><div><br =
class=3D""></div><div>bsdinstall(8) uses only dialog(1) in the context =
of $DIALOG</div><div><br class=3D""></div><div>ASIDE: It also uses =
dialog(3) and dpv(3)/dpv(1)</div><div><br class=3D""></div><br =
class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div =
class=3D"">* I seem bsdconfig(8) does not "call" these 4 scripts, so, =
probably,<br class=3D""> &nbsp;Xdialog(1) is not used in this context =
(that is `bsdconfig -X`).<br class=3D""><br =
class=3D""></div></div></blockquote><div><br =
class=3D""></div><div>Correct, bsdconfig does use =
bsdinstall</div><div><br class=3D""></div><br class=3D""><blockquote =
type=3D"cite" class=3D""><div class=3D""><div class=3D"">Is there any =
objection to delete $DIALOG/LGPL-dialog/Xdialog to<br class=3D"">provide =
only the support for bsddialog(1) in bsdinstall(8)?<br class=3D""><br =
class=3D""></div></div></blockquote><div><br class=3D""></div><div>I =
object.</div><div><br class=3D""></div><div>I and another developer are =
adding support for zenity</div><div><br class=3D""></div><div><a =
href=3D"https://github.com/FrauBSD/pkgcenter/tree/bsdconfig/zenity/depend/=
bsdconfig" =
class=3D"">https://github.com/FrauBSD/pkgcenter/tree/bsdconfig/zenity/depe=
nd/bsdconfig</a></div><div><br class=3D""></div><div>There is also work =
to resolve the namespace issues in bsdinstall</div><div><br =
class=3D""></div><div><a =
href=3D"https://github.com/FrauBSD/pkgcenter/tree/bsdinstall/namespace/dep=
end/bsdconfig" =
class=3D"">https://github.com/FrauBSD/pkgcenter/tree/bsdinstall/namespace/=
depend/bsdconfig</a></div><div><br class=3D""></div><div>I am in favor =
of keeping $DIALOG/LGPL-dialog/Xdialog support where it exists until =
those efforts can be completed.</div><div><br class=3D""></div><div>ASIDE:=
 bsdinstall doesn=E2=80=99t use Xdialog</div><div><br class=3D""></div><br=
 class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><div =
class=3D"">I would prefer this solution because I can avoid: to handle =
some<br class=3D"">dialog/Xdialog/bsddialog command line difference and =
to hook some<br class=3D"">bsdconfig function built on dialog(1) =
incompatible with bsddialog(1)<br class=3D"">(for example autosizing, =
implemented in bsddialog(3) already).<br class=3D""><br =
class=3D""></div></div></blockquote><div><br class=3D""></div><div>The =
differences in command line should be handled through conditionals, but =
can be the default and opt to handle LGPL-dialog through a =
USE_GNU_DIALOG flag</div><div><br class=3D""></div><div>bsddialog may =
support auto-sizing, but so does dialog and Xdialog.</div><div><br =
class=3D""></div><div>However, ...</div><div><br class=3D""></div><div>The=
 sizing code in bsdconfig (used indirectly by bsdinstall) was written =
because the auto-sizing that does exist and is available in both dialog =
and Xdialog (as well as Zenity) does not provide a cohesive experience =
when trying to write a program that is in-reality a series of bespoke =
dialogs.</div><div><br class=3D""></div><div>The sizing code makes sure =
that regardless of which utility you are using that the experience is =
uniform in what is presented to the user.</div><div><br =
class=3D""></div><div>Attempting to rely solely on the auto-sizing =
available from these separate utilities (including bsddialog) would =
change the UI/UX.</div><div><br class=3D""></div><div>The problem was =
solved by:</div><div><br class=3D""></div><div>1. Making the stored text =
used for dialogs dictate how it will look</div><div>2. Painstakingly =
determining where each utility failed given the text</div><div>3. =
Determining how to make the utility display the text =
properly</div><div><br class=3D""></div><div>For example, stored text =
will contain newlines instead of attempting to rely on line wrapping on =
a box of given size.</div><div><br class=3D""></div><div>I would have to =
evaluate bsddialog=E2=80=99s auto-sizing to determine if it is =
trust-worthy given not only all the stored texts, but all the =
translations as well (as bsdconfig is i18n compatible). It is actually =
less work to just allow bsdconfig to likely treat bsddialog as it is =
dialog and let it perform the size calculations for you.</div><div><br =
class=3D""></div><div>If bsddialog is top be a drop-in replacement, =
I=E2=80=99m more than a little surprised that it cannot accept the sizes =
calculated for dialog being passed to it.</div><div><br =
class=3D""></div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D""><div class=3D""><br class=3D"">Please note these =
considerations are only for bsdinstall, bsdconfig is<br =
class=3D"">unchanged.<br class=3D""><br =
class=3D""></div></div></blockquote><div><br class=3D""></div><div>What =
of dpv? bsdinstall uses dpv(3) to unpack the dists which in-turn relies =
on dlg_gauge_reallocate(3) from =
LGPL-dialog?</div><div>=E2=80=94&nbsp;</div><div>Devin</div></div></body><=
/html>=

--Apple-Mail=_D33AF0BD-A25C-40EC-A4F1-2EC18FDE640D--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6D8C34A7-3219-4562-BA10-E6A96355A237>