From owner-svn-src-user@FreeBSD.ORG Sat Jun 23 08:36:50 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 6C455106567B; Sat, 23 Jun 2012 08:36:50 +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 461DF8FC21; Sat, 23 Jun 2012 08:36:50 +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 q5N8aoaJ030050; Sat, 23 Jun 2012 08:36:50 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5N8aoxl030048; Sat, 23 Jun 2012 08:36:50 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201206230836.q5N8aoxl030048@svn.freebsd.org> From: Doug Barton Date: Sat, 23 Jun 2012 08:36:50 +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: r237473 - 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, 23 Jun 2012 08:36:50 -0000 Author: dougb Date: Sat Jun 23 08:36:49 2012 New Revision: 237473 URL: http://svn.freebsd.org/changeset/base/237473 Log: Various fixes to IPC_SAVE: 1. In safe_exit() always zero out the file before writing. This is probably redundant now given the following change, but I'll leave it in to be safe for now. 2. Zero out the file after reading it. The change in r236996 could lead to the parent process reading a stale file under certain circumstances. The combination of things that need to happen for this to occur are complex, but not impossible. 3. Move the writing of $PM_BUILD_ONLY_LIST - related variables into safe_exit(). When originally put in the previous location it saved what could have been a spurious test, but that test was long ago added to safe_exit(). Also, by not writing it there it could be missed in certain circumstances where the exit happened without reaching that code in the main script. This brings all the code that writes to the file into safe_exit() 4. NB_DELETE can only be set while building, so move writing it to that section. When -F, and the port has no distfiles, report that explicitly Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Sat Jun 23 07:49:10 2012 (r237472) +++ user/dougb/portmaster/portmaster Sat Jun 23 08:36:49 2012 (r237473) @@ -261,8 +261,8 @@ safe_exit () { [ -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 - > $IPC_SAVE echo "DISPLAY_LIST='$DISPLAY_LIST'" >> $IPC_SAVE echo "INSTALLED_LIST='$INSTALLED_LIST'" >> $IPC_SAVE @@ -273,9 +273,21 @@ safe_exit () { [ "$i" = "$portdir" ] && continue pnu_temp="${pnu_temp}${i} " done - PM_NEEDS_UPDATE=" ${pnu_temp}" + + [ -z "$NO_BACKUP" -a -z "$BACKUP" ] && echo "NB_DELETE='$NB_DELETE'" >> $IPC_SAVE else + if [ "$PM_BUILD_ONLY_LIST" = pmp_doing_build_deps ]; then + echo "build_only_dl_g='$build_only_dl_g'" >> $IPC_SAVE + echo "run_dl_g='$run_dl_g'" >> $IPC_SAVE + rundep_list=`uniquify_list $rundep_list` + echo "rundep_list='$rundep_list'" >> $IPC_SAVE + for f in $rundep_list; do + eval echo "export $f=\'\$$f\'" >> $IPC_SAVE + eval echo "export ${f}_p=\'\$${f}_p\'" >> $IPC_SAVE + done + fi + # Do these here so +IGNOREME can modify them echo "num_of_deps='$num_of_deps'" >> $IPC_SAVE echo "build_l='$build_l'" >> $IPC_SAVE @@ -284,7 +296,6 @@ safe_exit () { echo "CUR_DEPS='$CUR_DEPS'" >> $IPC_SAVE echo "dep_of_deps='$dep_of_deps'" >> $IPC_SAVE echo "PM_NEEDS_UPDATE='$PM_NEEDS_UPDATE'" >> $IPC_SAVE - [ -z "$NO_BACKUP" -a -z "$BACKUP" ] && echo "NB_DELETE='$NB_DELETE'" >> $IPC_SAVE if [ -n "$INTERACTIVE_UPDATE" ]; then echo "INTERACTIVE_YES='$INTERACTIVE_YES'" >> $IPC_SAVE echo "INTERACTIVE_NO='$INTERACTIVE_NO'" >> $IPC_SAVE @@ -2316,7 +2327,7 @@ update_port () { if [ -z "$NO_ACTION" -o -n "$PM_FIRST_PASS" ]; then ($0 $ARGS $1) || update_failed=update_failed - . $IPC_SAVE + . $IPC_SAVE && > $IPC_SAVE [ -n "$update_failed" ] && fail "Update for $1 failed" else pm_v "===>>> Build canceled due to -n flag" @@ -2815,7 +2826,7 @@ multiport () { num=$(( $num + 1 )) init_term_printf "$port ${num}/${numports}" ($0 $ARGS $port) || update_failed=update_failed - . $IPC_SAVE + . $IPC_SAVE && > $IPC_SAVE [ -n "$update_failed" ] && fail "Update for $port failed" case "$PM_NEEDS_UPDATE" in @@ -2859,7 +2870,7 @@ multiport () { num=$(( $num + 1 )) init_term_printf "$port ${num}/${numports}" ($0 $ARGS $port) || update_failed=update_failed - . $IPC_SAVE + . $IPC_SAVE && > $IPC_SAVE [ -n "$update_failed" ] && fail "Update for $port failed" done @@ -3281,6 +3292,8 @@ if [ -z "$PM_INDEX_ONLY" -a -z "$PM_BUIL rm -f ${TMPDIR}/f-${PM_PARENT_PID}-*-${portdir#*/}.* )& fi unset master_sites distfiles file DONT_FETCH fetchlog allfiles + elif [ -n "$FETCH_ONLY" ]; then + echo "===>>> No distfiles to fetch" fi if [ -z "$FETCH_ONLY" -a ! "$PM_PACKAGES" = only ]; then @@ -3319,22 +3332,7 @@ if [ -n "$PM_FIRST_PASS" ]; then [ -n "$PM_URB" -o -n "$PM_URB_UP" ] && PM_URB_DONE="${PM_URB_DONE}${upg_port}:" - if [ ! "$$" -eq "$PM_PARENT_PID" ]; then - # Save state for the parent process to read back in - > $IPC_SAVE - if [ "$PM_BUILD_ONLY_LIST" = pmp_doing_build_deps ]; then - echo "build_only_dl_g='$build_only_dl_g'" >> $IPC_SAVE - echo "run_dl_g='$run_dl_g'" >> $IPC_SAVE - rundep_list=`uniquify_list $rundep_list` - echo "rundep_list='$rundep_list'" >> $IPC_SAVE - for f in $rundep_list; do - eval echo "export $f=\'\$$f\'" >> $IPC_SAVE - eval echo "export ${f}_p=\'\$${f}_p\'" >> $IPC_SAVE - done - fi - - safe_exit - fi + [ "$$" -eq "$PM_PARENT_PID" ] || safe_exit check_fetch_only post_first_pass $portdir