Date: Fri, 17 Feb 2012 10:24:01 -0500 (EST) From: Greg Larkin <glarkin@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/165238: [PATCH] Resize port config dialog box in small windows Message-ID: <201202171524.q1HFO1XU023292@pm.sourcehosting.net> Resent-Message-ID: <201202171530.q1HFUFhQ051763@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 165238 >Category: ports >Synopsis: [PATCH] Resize port config dialog box in small windows >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Feb 17 15:30:15 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Greg Larkin >Release: FreeBSD 8.2-RELEASE-p3 amd64 >Organization: The FreeBSD Project >Environment: System: FreeBSD pm.sourcehosting.net 8.2-RELEASE-p3 FreeBSD 8.2-RELEASE-p3 #0: Tue Sep 27 18:45:57 UTC 2011 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 >Description: I use tmux in a shell window, and after splitting the screen into 3 panes, each with fewer than 15 lines, I was unable to run "make config" on my ports. >How-To-Repeat: Install tmux, start it, then split the window into as many panes as it takes to result in one with fewer than 15 lines. cd into a port directory with configurable options and type "make config". >Fix: The config target in bsd.port.mk uses a fixed size for the options config dialog box, and dialog(1) exits if it cannot draw on the reduced size screen. The attached patch calculates the number of screen lines using tput(1) and adjusts the dialog box size. The size of the box is limited to the previous setting of 21 lines high, and the config target exits if the size is too small to render the box readably. --- bsd.port.mk.config-dialog-resize.diff begins here --- --- bsd.port.mk.orig 2012-02-16 17:36:18.000000000 -0500 +++ bsd.port.mk 2012-02-17 10:15:52.000000000 -0500 @@ -5998,7 +5998,16 @@ done; \ TMPOPTIONSFILE=$$(mktemp -t portoptions); \ trap "${RM} -f $${TMPOPTIONSFILE}; exit 1" 1 2 3 5 10 13 15; \ - ${SH} -c "${DIALOG} --checklist \"Options for ${PKGNAME:C/-([^-]+)$/ \1/}\" 21 70 15 $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \ + TERMLINES=$$(tput lines); \ + [ $${TERMLINES} -gt 21 ] && TERMLINES=21; \ + if [ $${TERMLINES} -lt 15 ] ; then \ + ${ECHO_MSG} "=> The terminal window is too small for the options dialog."; \ + ${ECHO_MSG} "=> Please correct this problem and try again."; \ + exit 1; \ + else \ + LISTLINES=`${EXPR} $${TERMLINES} - 6`; \ + fi; \ + ${SH} -c "${DIALOG} --checklist \"Options for ${PKGNAME:C/-([^-]+)$/ \1/}\" $${TERMLINES} 70 $${LISTLINES} $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \ status=$$?; \ if [ $${status} -ne 0 ] ; then \ ${RM} -f $${TMPOPTIONSFILE}; \ --- bsd.port.mk.config-dialog-resize.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202171524.q1HFO1XU023292>