Page MenuHomeFreeBSD

bsdconfig(8): Add bsddialog(1) support
Needs ReviewPublic

Authored by asiciliano on Apr 2 2022, 9:07 PM.



Add bsddialog(1) front end for bsdconfig(8).

== bsdconfig ==

                        | bsdconfig |   Menu to choose:

 +------------+  +------------+  +----------+  +----------+
 | docinstall |  | networking |  | packages |  | timezone |  ....
 +------------+  +------------+  +----------+  +----------+



 | Middleware: functions to abstract the level below,           |
 |             (mainly in share/ common.subr, dialog.subr, ...) |

               |                             |
               v                             v     ^
 +-----------+  +------------+        +----------------- +
 | dialog(1) |  | Xdialog(1) |        |   bsdinstall(8)  |
 +-----------+  +------------+        +------------------+
  dialog, Xdialog, and now             bsdconfig uses docsinstall and
  bsddialog are used via               partedit;
  middleware.                          some bsdinstall script includes
  | bsddialog(1) |


Add hooks to allow bsdconfig(8) to use bsddialog(1).
DIALOG=dialog in share/dialog.subr restores dialog(1) by default.

Added TUI_UTILITY to allow bsdinstall scripts to continue to use dialog.
It should be deleted after the "dialog-bsddialog" replacementent.

This is the minimum changes solution, of course can be improved.
DIALOG=dialog restores dialog(1) so a shell scripting expert can add a command-line option to use also dialog(1) useful: for unicode characters and for using bsdconfig(8)' s autosize menu code (*). Otherwise the code for dialog(1) can be deleted, I have not a strong option.

(*) bsddialog should support unicode already, I has to change strlen() with a function to get the right string length. Autosize with --backtitle is easily improved. Both problems are in TODO list).

TUI_UTILITY allows to continue the weekly replacements avoiding one-big-change for bsdinstall. The remaining scripts are: auto, bootconfig, docinstall, hosyname, jail, keymap, netconfig_ipv4, netconfig_ipv6, script, wlanconfig, zfsboot.

Test Plan

Comparison: bsdconfig-dialog / bsdconfig-bsddialog ( / something bsdconfig -X).
The only problem (with all) is a not finished "waiting" for Packages, probably the cause is my connection.

Diff Detail

rG FreeBSD src repository
Lint Skipped
Unit Tests Skipped

Event Timeline

asiciliano retitled this revision from bsdconfig(8): Add bsddialog support to bsdconfig(8): Add bsddialog(1) support.Apr 3 2022, 1:44 PM
asiciliano edited the test plan for this revision. (Show Details)

Fix typo and delete useless -if-.

Sorry about the noise.

Fix: Use f_replace_all() otherwise --separate-output is irrelevant, found while converting the latest bsdinstall components.

bapt added inline comments.

tag is not obtained via ... (sounds more english to my french ears :D

This revision is now accepted and ready to land.Apr 15 2022, 2:33 PM
This revision now requires review to proceed.Apr 15 2022, 5:54 PM
asiciliano added inline comments.


This looks pretty well thought out. Give me some time to review it and get back to you. Thank you for your efforts.