From nobody@FreeBSD.org  Sun Oct 12 08:44:41 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 270D91065693
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 12 Oct 2008 08:44:41 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 15F098FC1E
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 12 Oct 2008 08:44:41 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id m9C8ieZ4018004
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 12 Oct 2008 08:44:40 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id m9C8iec9018003;
	Sun, 12 Oct 2008 08:44:40 GMT
	(envelope-from nobody)
Message-Id: <200810120844.m9C8iec9018003@www.freebsd.org>
Date: Sun, 12 Oct 2008 08:44:40 GMT
From: Stan Behrens <lists.freebsd.org@sbeh.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Ports-Script do not recognize dialog-return-value
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         128028
>Category:       ports
>Synopsis:       bsd.port.mk - Ports-Script do not recognize dialog-return-value
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 12 08:50:02 UTC 2008
>Closed-Date:    Tue Feb 05 03:43:22 UTC 2013
>Last-Modified:  Tue Feb 05 03:43:22 UTC 2013
>Originator:     Stan Behrens
>Release:        7.1 Beta
>Organization:
>Environment:
FreeBSD  7.1-BETA FreeBSD 7.1-BETA #0: Sun Sep  7 13:49:18 UTC 2008     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
Hi,

a recently portsnap'ed ports-tree does not recognize a -1 return (failure) of dialog, so if your terminal is to small, dialog will die and return 255 (-1) which should then let return make config something other than zero.

Bye.
>How-To-Repeat:
run your favorite terminal-emulator, smaller it and type:
cd /usr/ports/ports-mgmt/portupgrade && make config-recursive; echo $?

and it will give you:
===> Setting user-specified options for portupgrade-2.4.6,2 and dependencies
cd /usr/ports/ports-mgmt/portupgrade && make config;
===> Options unchanged
cd /usr/ports/lang/ruby18 && make config;
===> Options unchanged
0

>Fix:
THIS IS A BAD PATCH: Because the return-value this ignored too! (Block starts with -@if), unfortunately my make-skill are limited.

Patch attached with submission follows:

--- /usr/ports/Mk/bsd.port.mk.orig	2008-10-12 10:25:34.000000000 +0000
+++ /usr/ports/Mk/bsd.port.mk	2008-10-12 10:39:20.000000000 +0000
@@ -5891,9 +5891,15 @@
 	${SH} -c "${DIALOG} --checklist \"Options for ${PKGNAME:C/-([^-]+)$/ \1/}\" 21 70 15 $${DEFOPTIONS} 2> $${TMPOPTIONSFILE}"; \
 	status=$$?; \
 	if [ $${status} -ne 0 ] ; then \
+		if [ $${status} -eq 255 ] ; then \
+			${ECHO_MSG} "===> Failed to set Options: "; \
+			${CAT} $${TMPOPTIONSFILE}; \
+			exit 1; \
+		else \
+			${ECHO_MSG} "===> Options unchanged"; \
+			exit 0; \
+		fi; \
 		${RM} -f $${TMPOPTIONSFILE}; \
-		${ECHO_MSG} "===> Options unchanged"; \
-		exit 0; \
 	fi; \
 	if [ ! -e ${TMPOPTIONSFILE} ]; then \
 		${ECHO_MSG} "===> No user-specified options to save for ${PKGNAME}"; \


>Release-Note:
>Audit-Trail:

From: Stan Behrens <lists.freebsd.org@sbeh.de>
To: bug-followup@FreeBSD.org, lists.freebsd.org@sbeh.de
Cc:  
Subject: Re: ports/128028: Ports-Script do not recognize dialog-return-value
Date: Sun, 12 Oct 2008 11:25:22 +0200

 This is a multi-part message in MIME format.
 --------------090607060402090100080603
 Content-Type: text/plain; charset=UTF-8; format=flowed
 Content-Transfer-Encoding: 7bit
 
 This patch should be better, but still bad.
 
 --------------090607060402090100080603
 Content-Type: text/plain;
  name="bsd.port.mk.patch"
 Content-Transfer-Encoding: base64
 Content-Disposition: inline;
  filename="bsd.port.mk.patch"
 
 LS0tIC91c3IvcG9ydHMvTWsvYnNkLnBvcnQubWsub3JpZwkyMDA4LTEwLTEyIDEwOjI1OjM0
 LjAwMDAwMDAwMCArMDAwMAorKysgL3Vzci9wb3J0cy9Nay9ic2QucG9ydC5tawkyMDA4LTEw
 LTEyIDExOjIyOjUwLjAwMDAwMDAwMCArMDAwMApAQCAtNTg5MSw5ICs1ODkxLDE0IEBACiAJ
 JHtTSH0gLWMgIiR7RElBTE9HfSAtLWNoZWNrbGlzdCBcIk9wdGlvbnMgZm9yICR7UEtHTkFN
 RTpDLy0oW14tXSspJC8gXDEvfVwiIDIxIDcwIDE1ICQke0RFRk9QVElPTlN9IDI+ICQke1RN
 UE9QVElPTlNGSUxFfSI7IFwKIAlzdGF0dXM9JCQ/OyBcCiAJaWYgWyAkJHtzdGF0dXN9IC1u
 ZSAwIF0gOyB0aGVuIFwKKwkJaWYgWyAkJHtzdGF0dXN9IC1lcSAyNTUgXSA7IHRoZW4gXAor
 CQkJJHtFQ0hPX01TR30gIj09PT4gRmFpbGVkIHRvIHNldCBPcHRpb25zOiAiOyBcCisJCQkk
 e0NBVH0gJCR7VE1QT1BUSU9OU0ZJTEV9OyBcCisJCWVsc2UgXAorCQkJJHtFQ0hPX01TR30g
 Ij09PT4gT3B0aW9ucyB1bmNoYW5nZWQiOyBcCisJCWZpOyBcCiAJCSR7Uk19IC1mICQke1RN
 UE9QVElPTlNGSUxFfTsgXAotCQkke0VDSE9fTVNHfSAiPT09PiBPcHRpb25zIHVuY2hhbmdl
 ZCI7IFwKLQkJZXhpdCAwOyBcCisJCWV4aXQgJCR7c3RhdHVzfTsgXAogCWZpOyBcCiAJaWYg
 WyAhIC1lICR7VE1QT1BUSU9OU0ZJTEV9IF07IHRoZW4gXAogCQkke0VDSE9fTVNHfSAiPT09
 PiBObyB1c2VyLXNwZWNpZmllZCBvcHRpb25zIHRvIHNhdmUgZm9yICR7UEtHTkFNRX0iOyBc
 Cg==
 --------------090607060402090100080603--
Responsible-Changed-From-To: freebsd-ports-bugs->portmgr 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Oct 12 10:17:36 UTC 2008 
Responsible-Changed-Why:  
bsd.port.mk is portmgr territory (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=128028 
State-Changed-From-To: open->feedback 
State-Changed-By: erwin 
State-Changed-When: Sat May 12 01:39:09 UTC 2012 
State-Changed-Why:  
Is this still an issue with newer dialog that is in the tree now? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=128028 
State-Changed-From-To: feedback->closed 
State-Changed-By: eadler 
State-Changed-When: Tue Feb 5 03:43:21 UTC 2013 
State-Changed-Why:  
if it is, we will find out. Feedback timeout 

http://www.freebsd.org/cgi/query-pr.cgi?pr=128028 
>Unformatted:
