From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Feb 17 15:30:15 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C668F106564A for ; Fri, 17 Feb 2012 15:30:15 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9A0F18FC13 for ; Fri, 17 Feb 2012 15:30:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q1HFUFBb051766 for ; Fri, 17 Feb 2012 15:30:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q1HFUFhQ051763; Fri, 17 Feb 2012 15:30:15 GMT (envelope-from gnats) Resent-Date: Fri, 17 Feb 2012 15:30:15 GMT Resent-Message-Id: <201202171530.q1HFUFhQ051763@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Greg Larkin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDA8C10656ED for ; Fri, 17 Feb 2012 15:24:09 +0000 (UTC) (envelope-from glarkin@pm.sourcehosting.net) Received: from mail1.sourcehosting.net (mail1.sourcehosting.net [74.205.51.45]) by mx1.freebsd.org (Postfix) with ESMTP id B0A7D8FC12 for ; Fri, 17 Feb 2012 15:24:09 +0000 (UTC) Received: from [192.168.100.97] (helo=pm.sourcehosting.net) by mail1.sourcehosting.net with esmtp (Exim 4.73 (FreeBSD)) (envelope-from ) id 1RyPfG-0002FY-0n for FreeBSD-gnats-submit@freebsd.org; Fri, 17 Feb 2012 10:24:09 -0500 Received: from pm.sourcehosting.net (localhost [127.0.0.1]) by pm.sourcehosting.net (8.14.4/8.14.4) with ESMTP id q1HFO1Xf023293 for ; Fri, 17 Feb 2012 10:24:01 -0500 (EST) (envelope-from glarkin@pm.sourcehosting.net) Received: (from glarkin@localhost) by pm.sourcehosting.net (8.14.4/8.14.4/Submit) id q1HFO1XU023292; Fri, 17 Feb 2012 10:24:01 -0500 (EST) (envelope-from glarkin) Message-Id: <201202171524.q1HFO1XU023292@pm.sourcehosting.net> Date: Fri, 17 Feb 2012 10:24:01 -0500 (EST) From: Greg Larkin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/165238: [PATCH] Resize port config dialog box in small windows X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Greg Larkin List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Feb 2012 15:30:15 -0000 >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: