From owner-cvs-all@FreeBSD.ORG Sat Aug 13 21:28:44 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 15E9B16A41F; Sat, 13 Aug 2005 21:28:44 +0000 (GMT) (envelope-from cperciva@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE51843D46; Sat, 13 Aug 2005 21:28:43 +0000 (GMT) (envelope-from cperciva@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j7DLShns080388; Sat, 13 Aug 2005 21:28:43 GMT (envelope-from cperciva@repoman.freebsd.org) Received: (from cperciva@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j7DLShWb080387; Sat, 13 Aug 2005 21:28:43 GMT (envelope-from cperciva) Message-Id: <200508132128.j7DLShWb080387@repoman.freebsd.org> From: Colin Percival Date: Sat, 13 Aug 2005 21:28:43 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/usr.sbin/portsnap/portsnap portsnap.sh X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Aug 2005 21:28:44 -0000 cperciva 2005-08-13 21:28:43 UTC FreeBSD src repository Modified files: usr.sbin/portsnap/portsnap portsnap.sh Log: Correctly exit from extract_run() and update_run() if files needed are missing from ${WORKDIR}/files/. This bug was caused by the astonishing interaction of "return" and pipelines; in the following code, the "return" does not exit the function, but instead exits the subshell which was spawned for the last element of the pipeline; consequently, the output produced is "foo". foo() { echo bar | while read baz; do if [ ${baz} = "bar" ]; then return 1 fi done echo foo } Reported by: simon Revision Changes Path 1.7 +9 -4 src/usr.sbin/portsnap/portsnap/portsnap.sh