Page MenuHomeFreeBSD

bsdconfig(8): Add bsddialog(1) support
AbandonedPublic

Authored by asiciliano on Apr 2 2022, 9:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 8:00 AM
Unknown Object (File)
Tue, Apr 9, 9:55 AM
Unknown Object (File)
Mar 9 2024, 1:40 AM
Unknown Object (File)
Mar 3 2024, 5:23 AM
Unknown Object (File)
Jan 17 2024, 4:45 PM
Unknown Object (File)
Jan 13 2024, 1:29 AM
Unknown Object (File)
Jan 12 2024, 2:20 PM
Unknown Object (File)
Dec 20 2023, 7:07 AM
Subscribers

Details

Reviewers
bapt
emaste
dteske
Summary

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

== bsdconfig ==


                        +-----------+
                        | bsdconfig |   Menu to choose:
                        +-----------+

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

                               |
                               v

========================================================================


 +--------------------------------------------------------------+
 | 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
                                       bsdconfig/share/.
  +--------------+
  | 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

Repository
rG FreeBSD src repository
Lint
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.
usr.sbin/bsdconfig/networking/share/resolv.subr
475

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.
usr.sbin/bsdconfig/networking/share/resolv.subr
475

Done

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

Abandon: This review excessively impacts on current features.