From owner-svn-src-user@FreeBSD.ORG Sat Jul 7 10:13:21 2012 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 0AF941065675; Sat, 7 Jul 2012 10:13:21 +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 E05418FC1D; Sat, 7 Jul 2012 10:13:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q67ADKuB038487; Sat, 7 Jul 2012 10:13:20 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q67ADKOj038485; Sat, 7 Jul 2012 10:13:20 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201207071013.q67ADKOj038485@svn.freebsd.org> From: Doug Barton Date: Sat, 7 Jul 2012 10:13:20 +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: r238195 - 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: Sat, 07 Jul 2012 10:13:21 -0000 Author: dougb Date: Sat Jul 7 10:13:20 2012 New Revision: 238195 URL: http://svn.freebsd.org/changeset/base/238195 Log: For --features: * Most don't create $IPC_SAVE, so don't try to source it in a trap if it doesn't exist * $grep_deps may exist for some features, like --check-depends, so always delete it in safe_exit if it exists Other: * Don't try to clean out WRKDIRPREFIX if we're not actually building * In update_contents() streamline the code that handles replacing the file if necessary * Simplify the whitespace in the code that updates dependencies after an install, there will always be at least one pm_v printed, so no need to be coy about it Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Sat Jul 7 08:19:34 2012 (r238194) +++ user/dougb/portmaster/portmaster Sat Jul 7 10:13:20 2012 (r238195) @@ -73,7 +73,7 @@ trap_exit () { fi if [ "$$" -eq "$PM_PARENT_PID" ]; then - . $IPC_SAVE + [ -s "$IPC_SAVE" ] && . $IPC_SAVE local n=0 while ps -axo pid,ppid,command | grep -v egrep | @@ -100,7 +100,7 @@ trap_exit () { if ! ls ${TMPDIR}/f-${PM_PARENT_PID}-TEAC\.* >/dev/null 2>&1; then pm_mktemp TEAC # Trap Exit Already Called else - . $IPC_SAVE + [ -s "$IPC_SAVE" ] && . $IPC_SAVE fi fi safe_exit 1 @@ -165,7 +165,7 @@ parent_exit () { /bin/unlink $f done - if [ -n "$PM_WRKDIRPREFIX" -a -z "$1" ]; then + if [ -n "$PM_WRKDIRPREFIX" ] && [ -n "$PM_BUILDING" -a -z "$1" ]; then count=0 while : ; do ps axww | grep '[m]ake clean NOCLEANDEPENDS=ncd' >/dev/null || break @@ -256,11 +256,11 @@ parent_exit () { } safe_exit () { + [ -n "$grep_deps" ] && pm_unlink $grep_deps + if [ "$$" -eq "$PM_PARENT_PID" ]; then parent_exit $1 else - [ -n "$grep_deps" ] && pm_unlink $grep_deps - # Save state for the parent process to read back in > $IPC_SAVE if [ -z "$PM_FIRST_PASS" ]; then @@ -1102,12 +1102,13 @@ IFS=' done [ -n "$prev_line" ] && echo $prev_line >> $new_cont - cmp -s $contents $new_cont && { /bin/unlink $new_cont ; return; } + if ! cmp -s $contents $new_cont; then + check_regular_file $contents + pm_v " ===>>> Installing the new +CONTENTS file" + pm_install_s $new_cont $contents + fi - check_regular_file $contents - pm_v " ===>>> Installing the new +CONTENTS file" - pm_install_s $new_cont $contents - pm_unlink $new_cont + /bin/unlink $new_cont } find_moved_port () { @@ -1310,7 +1311,7 @@ parse_index () { } update_required_by () { - # Global: grep_deps needws + # Global: needws local do_update if [ -e "$pdb/$1/+REQUIRED_BY" ]; then @@ -3955,17 +3956,14 @@ if [ -s "$grep_deps" ]; then if [ -n "$ro_opd" ] && grep -ql "DEPORIGIN:$ro_opd$" $dp_cont; then update_contents $dp_cont $portdir $new_port $ro_opd - needws=needws fi # Do this one last so it can get deleted as a duplicate # if ro_opd is present. if grep -ql "DEPORIGIN:$portdir$" $dp_cont; then update_contents $dp_cont $portdir $new_port - needws=needws fi done < $grep_deps - [ -n "$needws" ] && pm_v - unset d_port dp_cont do_update needws + unset d_port dp_cont ; pm_v update_required_by $new_port [ -n "$needws" ] && { pm_v; unset needws; }