Resurrect dialog progress view -- disconnected from the build since
LGPL dialog(3) removal -- as libbsdpv/bsdpv, with the public API
renamed dpv_* to bsdpv_* to mark a clean break from the code that
required GNU dialog.
libdpv depended on dlg_gauge_reallocate(), which bsddialog(3) does not
provide. The dialog renderer is instead written to a persistent gauge
API -- bsddialog_gauge_open(), _update(), _flush(), _close() -- that
gives the caller ownership of the widget lifecycle rather than
respawning the gauge on every update. That API is proposed upstream
(bsddialog merge request 12) but has not yet landed, so contrib/bsddialog
1.1 cannot satisfy it; bsddialog(3) support is therefore a compile-time
option, BSDPV_BSDDIALOG, defaulting to off. The default build compiles
the dialog renderer out under HAVE_BSDDIALOG guards and links against
libutil alone -- no bsddialog, no ncurses. Flip the default when contrib
grows the API. Terminal styling that previously reached into dialog's
color table now derives from bsddialog_get_theme() and
bsddialog_color_attrs(). The DPV_DISPLAY_DIALOG and DPV_DISPLAY_XDIALOG
spawn modes are removed: the former exec'd the GPL utility this change
exists to shed, and the latter served a long-dead X11 port. libfigpar
stays disconnected because its only consumer here was .dialogrc parsing
and bsddialog has no .dialogrc support; the one general-purpose routine
libdpv used from it, strexpandnl(), is absorbed as a private utility.
Both new components are PRIVATELIB, matching libbsddialog, so no
external ABI is promised.
The utility defaults to a command-line progress view on standard error;
-D selects the bsddialog(3) gauge when built with that support and is
refused otherwise. A new CLI renderer in libbsdpv paints per-file bars,
an optional Overall row (-m), -a text, and the status line with CSI
updates, decoupled from the gauge refresh rate (-U). Library callers
that leave display_type zero still get BSDPV_DISPLAY_BSDDIALOG for ABI
stability; a build without bsddialog support treats that request as
BSDPV_DISPLAY_CLI. bsdpv_announce(3) exposes transient Opening/Waiting
status while blocked outside the main progress loop (FIFO peers, -m
paths); honor -U 0 by not remapping zero to the default rate and by
clearing leftover announce text when progress resumes. Multi-path (-m)
mode opens paths serially, treats '-' as /dev/stdin, and uses
non-blocking FIFO I/O so the UI stays responsive.
Three latent bugs inherited from dpv are fixed in the port: the
status-line formats given with -i/-I were unconditionally clobbered
after option parsing (and the many-files default was assigned the
solo-file format); the /dev/stdin descriptor heuristic was applied even
when stdin was a pipe, driving the input descriptor negative when -o or
-x was in use; and a transfer that ended between display updates could
exit without rendering its final Done/Fail state.
Add a pkgbase package for bsdpv. While here, fix creation of
$INCDIR/private/bsdpv/ by modifying share/mk/bsd.incs.mk.