From owner-freebsd-current@FreeBSD.ORG Tue Sep 2 23:11:51 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0BF399E; Tue, 2 Sep 2014 23:11:51 +0000 (UTC) Received: from shxd.cx (unknown [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A12312F3; Tue, 2 Sep 2014 23:11:51 +0000 (UTC) Received: from 50-196-156-133-static.hfc.comcastbusiness.net ([50.196.156.133]:54791 helo=THEMADHATTER) by shxd.cx with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1XObLI-0006Rm-H8; Mon, 01 Sep 2014 16:49:00 -0700 From: To: , "'freebsd-current'" References: <02c501cfc6e1$b397e050$1ac7a0f0$@FreeBSD.org> In-Reply-To: <02c501cfc6e1$b397e050$1ac7a0f0$@FreeBSD.org> Subject: RE: [CFT] Installer Enhancement -- dpv Date: Tue, 2 Sep 2014 16:11:44 -0700 Message-ID: <037b01cfc703$43feb8f0$cbfc2ad0$@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQHj1DE0nhKF4Ruc0A9xicszRgbnQZvGXgQQ Content-Language: en-us Sender: devin@shxd.cx Cc: 'Julian Elischer' , 'Nathan Whitehorn' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 23:11:51 -0000 I have posted this on reviews.f.o: https://reviews.freebsd.org/D714 -- Cheers, Devin > -----Original Message----- > From: devin@shxd.cx [mailto:devin@shxd.cx] On Behalf Of > dteske@FreeBSD.org > Sent: Tuesday, September 2, 2014 12:11 PM > To: 'freebsd-current' > Cc: dteske@FreeBSD.org; 'Julian Elischer'; 'Nathan Whitehorn' > Subject: [CFT] Installer Enhancement -- dpv > > Hi all, > > I've completed a significant enhancement to bsdinstall's distextract. > > Current code: > http://svnweb.freebsd.org/base/head/usr.sbin/bsdinstall/distextract/ > > Proposed Patch: > http://druidbsd.sf.net/download/dpv-1.1-freebsd-head-patch-20140830.txt > > NB: Proposed commit message further below (after length "Story" section). > > Proposal is to commit this in 2 weeks and MFC to stable/10 *after* the > 10.1-RELEASE (likely January MFC). > > Patched FreeBSD-9.3-STABLE-i386-20140820-r270206-disc1.iso: > http://locheil.shxd.cx/FreeBSD-9.3-i386+dpv-1.1.iso > > I'd like to ask for community help in testing the improved distextract > (especially over serial). > > NOTE: The only thing that I've changed in this patch and the above > patched image was the distextract code. So the unpacking of the OS > to the target installation media will look different than it does > currently, but other than that no changes. > > Story: > > I really liked the direction that bsdinstall took in utilizing dialog(3)'s > dialog_mixedgauge() widget -- allowing us to, unlike sysinstall, show > overall progress for multiple items. However, I wanted to bring back > some things from sysinstall which were nice -- such as the status info > displayed along the bottom of the terminal (showing data through- > put). > > The problem I had was that dialog_mixedgauge() is not very flexible. > That being said, there are quite a few places where dialog_mixedgauge() > is used: > > + bsdinstall distextract > + bsdinstall distfetch > > And I would really like to use it in bsdconfig for package installation. > However, due to known short-comings I have not yet utilized that > widget in bsdconfig. > > Knowing that I would potentially have to duplicate the work I perform > on distextract two or three times over, I chose to develop a replacement > for dialog_mixedgauge() in the form of separate library (in its own > directory). > > The result is the "dpv" library -- styled after "pv" from ports (in the > sysutils category but does more): http://freshports.org/sysutils/pv > > It also comes with a "dpv" utility. A mixture of bsdconfig, bsdinstall, > and other utilities should consume both the library and utility: > > + bsdinstall distextract will use dpv(3) in place of dialog_mixedgauge() > NB: See above-mentioned patch "dpv-1.1-freebsd-head-patch-*.txt" > + bsdinstall distfetch will use the same > + bsdconfig packages will use dpv(1) in place of dialog(1) --infobox > + A new tool "dpkg" will use dpv(3) to visualize pkg(1) EVENT_PIPE data > + bsdconfig packages will use new "dpkg" tool to visualize pkg mgmt > versus simply using dialog --infobox as it currently does > > How the dpv(3) library function works is by not using dialog_mixedgauge() > (which was found to be very inflexible) but rather using dialog(3)'s more > flexible dialog_gauge() widget. The secret behind getting a better widget > is that dialog_gauge() allows you to dynamically update the prompt text > after it has been called to life. The dpv(3) library renders prompt text > similar to what you get with dialog_mixedgauge() but requires less work, > is more flexible, and works around the shortcomings of the latter. > > For even more backstory, see my blog: > http://devinteske.com/freebsd-installer-enhancements/ > > Proposed commit message: > > In bsdinstall's distextract, replace mixed_gauge() of dialog(3) with > new dpv(3) wrapper to dialog(3) dialog_gauge(). The dpv(3) library provides > a more flexible and refined interface similar to dialog_mixedgauge() > however > is implemented atop the more generalized dialog_gauge() for portability. > This commit also introduces dpv(1) as a full test program for dpv(3). > Noticeable improvements in bsdinstall's distextract will be a status line > showing data rate information (with support for localeconv(3) to format > numbers according to $LANG or $LC_ALL conversion information), i18n > support, > improved auto-sizing of gauge widget, a ``wheel barrow'' to keep the user > informed that things are moving (even if status/progress has not changed), > improved color support (mini-progress bars use the same color, if enabled, > as the main gauge bar), and several other improvements (some not visible). > dpv stands for "dialog progress view". > > Discussed on: -current > Reviewed by: > Tested by: jelischer, > Relnotes: yes > MFC after: 4 months > X-MFC-to: stable/10, stable/9 > --This line, and those below, will be ignored-- > M usr.sbin/bsdinstall/distextract/Makefile > M usr.sbin/bsdinstall/distextract/distextract.c > M share/mk/bsd.libnames.mk > M lib/Makefile > A lib/libdpv > AM lib/libdpv/Makefile > AM lib/libdpv/dialog_util.c > AM lib/libdpv/dialog_util.h > AM lib/libdpv/dialogrc.c > AM lib/libdpv/dialogrc.h > AM lib/libdpv/dprompt.c > AM lib/libdpv/dprompt.h > AM lib/libdpv/dpv.3 > AM lib/libdpv/dpv.c > AM lib/libdpv/dpv.h > AM lib/libdpv/dpv_private.h > AM lib/libdpv/status.c > AM lib/libdpv/status.h > AM lib/libdpv/util.c > AM lib/libdpv/util.h > A lib/libfigpar > AM lib/libfigpar/Makefile > AM lib/libfigpar/figpar.3 > AM lib/libfigpar/figpar.c > AM lib/libfigpar/figpar.h > AM lib/libfigpar/string_m.c > AM lib/libfigpar/string_m.h > M usr.bin/Makefile > A usr.bin/dpv > AM usr.bin/dpv/Makefile > AM usr.bin/dpv/dpv.1 > AM usr.bin/dpv/dpv.c > AM usr.bin/dpv/dpv_util.h > > -- > Cheers, > Devin