From owner-svn-src-user@FreeBSD.ORG Fri Aug 6 01:08:12 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DC221065675; Fri, 6 Aug 2010 01:08:12 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51A138FC12; Fri, 6 Aug 2010 01:08:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7618Cav060176; Fri, 6 Aug 2010 01:08:12 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7618CX6060174; Fri, 6 Aug 2010 01:08:12 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201008060108.o7618CX6060174@svn.freebsd.org> From: Doug Barton Date: Fri, 6 Aug 2010 01:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210906 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2010 01:08:12 -0000 Author: dougb Date: Fri Aug 6 01:08:12 2010 New Revision: 210906 URL: http://svn.freebsd.org/changeset/base/210906 Log: 1. Use a better, more generic method of signaling an abnormal exit 2. Call safe_exit with a status of 1 from more places. The specific problem the latter solves is when using -r/f but not -R, and PM_UPGRADE_DONE_FLAG files exist from a previous run. If an abnormal exit is not signaled when necessary in this situation the flags will get deleted even though we want to keep them. This is likely the cause of some of the vague problem reports I have received in the past that include complaints of, "I used -r/f and -R but portmaster still rebuilt certain ports a whole bunch of times." Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Fri Aug 6 00:52:23 2010 (r210905) +++ user/dougb/portmaster/portmaster Fri Aug 6 01:08:12 2010 (r210906) @@ -68,8 +68,6 @@ fail () { } trap_exit () { - TRAP=trap - echo '' # Helps if the previous message was 'echo -n' if [ -n "$portdir" -a -z "$1" ]; then echo "===>>> Build/Install for $portdir exiting due to signal" @@ -134,7 +132,7 @@ parent_exit () { fi [ -n "$FETCH_ONLY" -a -z "$FETCH_ONLY_DONE" ] && kill_bad_children - if [ -z "$TRAP" ]; then + if [ -z "$1" ]; then if [ -n "$UPDATE_REQ_BYS" -o -n "$PM_FORCE" ]; then files=`find $pdb -type f -name PM_UPGRADE_DONE_FLAG` if [ -n "$files" ]; then @@ -158,7 +156,7 @@ parent_exit () { for f in ${TMPDIR}/f-${PM_PARENT_PID}-*; do pm_unlink $f ; done case "$DISPLAY_LIST" in - *' '*) if [ -n "$TRAP" ]; then + *' '*) if [ -n "$1" ]; then echo "===>>> There are messages from installed ports to display," echo " but first take a moment to review the error messages" echo -n " above. Then press Enter when ready to proceed. " @@ -224,7 +222,7 @@ parent_exit () { safe_exit () { if [ "$$" -eq "$PM_PARENT_PID" ]; then - parent_exit + parent_exit $1 else [ -n "$grep_deps" ] && pm_unlink $grep_deps @@ -2414,7 +2412,7 @@ post_first_pass () { [nN]*) echo '' echo "===>>> If you would like to upgrade or install some, but not" echo " all of the above try adding '-i' to the command line." - safe_exit ;; + safe_exit 1 ;; esac unset build_l fi @@ -2876,10 +2874,10 @@ if [ -n "$upg_port" -a -z "$portdir" ]; case "$?" in 3) echo '' echo "===>>> BSDPAN ports cannot be upgraded with portmaster" - echo " (${upg_port})"; echo ''; safe_exit ;; + echo " (${upg_port})"; echo ''; safe_exit 1 ;; 2) [ -z "$PM_VERBOSE" ] && { echo " ===>>> No ORIGIN for $upg_port, and +IGNOREME is present"; - echo ''; }; safe_exit ;; + echo ''; }; safe_exit 1 ;; *) fail 'Cannot continue' ;; esac ; } elif [ -z "$portdir" ]; then