From quakelee@tarsier.delphij.net  Thu Feb 11 02:55:41 2010
Return-Path: <quakelee@tarsier.delphij.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2154E106566C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Feb 2010 02:55:41 +0000 (UTC)
	(envelope-from quakelee@tarsier.delphij.net)
Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 256AE8FC16
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Feb 2010 02:55:39 +0000 (UTC)
Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233])
	by tarsier.geekcn.org (Postfix) with ESMTP id B7713A5FFE9
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Feb 2010 10:55:33 +0800 (CST)
Received: from tarsier.geekcn.org ([211.166.10.233])
	by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024)
	with LMTP id HCnMwX+W0FEy for <FreeBSD-gnats-submit@freebsd.org>;
	Thu, 11 Feb 2010 10:55:24 +0800 (CST)
Received: from tarsier.delphij.net (tarsier.cn.freebsd.org [211.166.10.234])
	by tarsier.geekcn.org (Postfix) with ESMTP id AFDFCA567AC
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Feb 2010 10:55:23 +0800 (CST)
Received: by tarsier.delphij.net (Postfix, from userid 1002)
	id 66300E0477; Thu, 11 Feb 2010 10:55:23 +0800 (CST)
Message-Id: <20100211025523.66300E0477@tarsier.delphij.net>
Date: Thu, 11 Feb 2010 10:55:23 +0800 (CST)
From: CHAO Shin <quakelee@geekcn.org>
Reply-To: CHAO Shin <quakelee@geekcn.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: add passive mode to pkg_add cdrtools in jail when making release
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         143785
>Category:       misc
>Synopsis:       [build] [patch] add passive mode to pkg_add cdrtools in jail when making release
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 11 03:00:01 UTC 2010
>Closed-Date:    
>Last-Modified:  Sun Mar 21 06:40:01 UTC 2010
>Originator:     CHAO Shin
>Release:        FreeBSD 8.0-RELEASE-p2 amd64
>Organization:
GeekCN
>Environment:
System: System: FreeBSD usbuilder.intra.umessage.com.cn 8.0-RELEASE FreeBSD 8.0-RELEASE #1: Fri Nov 27 12:35:54 CST 2009 root@usbuilder.intra.umessage.com.cn:/usr/obj/usr/src/sys/UMESSAGE amd64

>Description:
	If made release on a box behind the firewall or nat gate, pkg_add cdrtools would failed, because of fetching package failed.
	Add trying in passive mode after the first trying failed.

>How-To-Repeat:
	make release on a box behind firewall
>Fix:

--- release.diff begins here ---
Index: release/powerpc/mkisoimages.sh
===================================================================
--- release/powerpc/mkisoimages.sh	(revision 202676)
+++ release/powerpc/mkisoimages.sh	(working copy)
@@ -44,9 +44,12 @@
 		cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean
 	else
 		if ! pkg_add -r cdrtools; then
-			echo "Could not get it via pkg_add - please go install this"
-			echo "from the ports collection and run this script again."
-			exit 2
+			export FTP_PASSIVE_MODE=yes
+			if ! pkg_add -r cdrtools; then
+				echo "Could not get it via pkg_add - please go install this"
+				echo "from the ports collection and run this script again."
+				exit 2
+			fi
 		fi
 	fi
 fi
Index: release/sparc64/mkisoimages.sh
===================================================================
--- release/sparc64/mkisoimages.sh	(revision 202676)
+++ release/sparc64/mkisoimages.sh	(working copy)
@@ -56,9 +56,12 @@
 		cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean
 	else
 		if ! pkg_add -r cdrtools; then
-			echo "Could not get it via pkg_add - please go install this"
-			echo "from the ports collection and run this script again."
-			exit 2
+			export FTP_PASSIVE_MODE=yes
+			if ! pkg_add -r cdrtools; then
+				echo "Could not get it via pkg_add - please go install this"
+				echo "from the ports collection and run this script again."
+				exit 2
+			fi
 		fi
 	fi
 fi
Index: release/i386/mkisoimages.sh
===================================================================
--- release/i386/mkisoimages.sh	(revision 202676)
+++ release/i386/mkisoimages.sh	(working copy)
@@ -47,9 +47,12 @@
 		cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean
 	else
 		if ! pkg_add -r cdrtools; then
-			echo "Could not get it via pkg_add - please go install this"
-			echo "from the ports collection and run this script again."
-			exit 2
+			export FTP_PASSIVE_MODE=yes
+			if ! pkg_add -r cdrtools; then
+				echo "Could not get it via pkg_add - please go install this"
+				echo "from the ports collection and run this script again."
+				exit 2
+			fi
 		fi
 	fi
 fi
Index: release/ia64/mkisoimages.sh
===================================================================
--- release/ia64/mkisoimages.sh	(revision 202676)
+++ release/ia64/mkisoimages.sh	(working copy)
@@ -56,8 +56,11 @@
     else
 	echo fetching the package...
 	if ! pkg_add -r ${MKISOFS_PKG}; then
-	    echo "error: cannot fetch ${MKISOFS}(8). Bailing out..."
-	    exit 2
+		export FTP_PASSIVE_MODE=yes
+		if ! pkg_add -r ${MKISOFS_PKG}; then
+			echo "error: cannot fetch ${MKISOFS}(8). Bailing out..."
+			exit 2
+		fi
 	fi
     fi
 fi
Index: release/amd64/mkisoimages.sh
===================================================================
--- release/amd64/mkisoimages.sh	(revision 202676)
+++ release/amd64/mkisoimages.sh	(working copy)
@@ -44,9 +44,12 @@
 		cd /usr/ports/sysutils/cdrtools && make install BATCH=yes && make clean
 	else
 		if ! pkg_add -r cdrtools; then
-			echo "Could not get it via pkg_add - please go install this"
-			echo "from the ports collection and run this script again."
-			exit 2
+			export FTP_PASSIVE_MODE=yes
+			if ! pkg_add -r cdrtools; then
+				echo "Could not get it via pkg_add - please go install this"
+				echo "from the ports collection and run this script again."
+				exit 2
+			fi
 		fi
 	fi
 fi
--- release.diff ends here ---


>Release-Note:
>Audit-Trail:

From: Garrett Cooper <yanegomi@gmail.com>
To: bug-followup@FreeBSD.org, quakelee@geekcn.org
Cc:  
Subject: Re: misc/143785: [build] [patch] add passive mode to pkg_add cdrtools 
	in jail when making release
Date: Sat, 20 Mar 2010 23:31:49 -0700

     This change doesn't make sense given the context that I briefly
 saw in the script. If you know this is going to be an issue, why don't
 you set passive mode in your FTP configuration by default?
 Thanks,
 -Garrett
>Unformatted:
