Date: Sun, 2 May 2010 03:28:29 +0000 (UTC) From: Doug Barton <dougb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r207489 - user/dougb/portmaster Message-ID: <201005020328.o423STaw031449@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dougb Date: Sun May 2 03:28:29 2010 New Revision: 207489 URL: http://svn.freebsd.org/changeset/base/207489 Log: In a couple places where default value setting is overly complex (including a couple of the places related to the recent ro_upg_port changes) simplify the code. When checking stat(1) for the INDEX updates we really want to check the time when the file was last modified for pedantic value, although in this scenario the practical effect was the same. In --check-port-dbdir we now need to check if the values in the loop are directories, since origin_from_pdb() now emits an error if it can't find ORIGIN. Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Sun May 2 02:00:20 2010 (r207488) +++ user/dougb/portmaster/portmaster Sun May 2 03:28:29 2010 (r207489) @@ -129,7 +129,7 @@ kill_bad_children () { } parent_exit () { - local files p f show_list + local files f show_list if [ -s "$DI_FILES" ]; then grep -q '%%%%%%%%%%%%' $DI_FILES || kill_bad_children @@ -169,11 +169,11 @@ parent_exit () { echo '' fi - [ -n "$PAGER" ] && p=$PAGER || p='less -e' + : ${PAGER:='less -e'} ( for f in $DISPLAY_LIST; do echo "===>>> pkg-message for $f" ; cat $pdb/$f/+DISPLAY ; echo '' done - echo "===>>> Done displaying pkg-message files" ) | $p + echo "===>>> Done displaying pkg-message files" ) | $PAGER ;; esac @@ -504,10 +504,10 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then fi PM_INDEX="${INDEXDIR}/${INDEXFILE}" - index_time=`stat -f '%Ua' ${PM_INDEX}.bz2 2>/dev/null` + index_time=`stat -f '%Um' ${PM_INDEX}.bz2 2>/dev/null` pm_sv Updating INDEX file $PM_SU_CMD $FETCHINDEX ${PM_INDEX}.bz2 ${MASTER_SITE_INDEX}${INDEXFILE}.bz2 - if [ $index_time -ne `stat -f '%Ua' ${PM_INDEX}.bz2 2>/dev/null` ]; then + if [ $index_time -ne `stat -f '%Um' ${PM_INDEX}.bz2 2>/dev/null` ]; then temp_index=`pm_mktemp index` bunzip2 < ${PM_INDEX}.bz2 > $temp_index pm_install_s $temp_index $PM_INDEX @@ -997,6 +997,8 @@ if [ -n "$CHECK_PORT_DBDIR" ]; then echo "===>>> Building list of installed port names"; echo '' for pkg in $pdb/*; do + [ -d $pkg ] || continue + unset unique_name iport=${pkg#$pdb/} @@ -3196,9 +3198,7 @@ fi # Ignore if no old port exists if [ -n "$upg_port" -o -n "$ro_upg_port" ]; then - UPGRADE_PORT=$upg_port - [ -n "$ro_upg_port" ] && UPGRADE_PORT="$ro_upg_port" - + UPGRADE_PORT="${ro_upg_port:-$upg_port}" UPGRADE_PORT_VER=`echo $UPGRADE_PORT | sed 's#.*-\(.*\)#\1#'` export UPGRADE_PORT UPGRADE_PORT_VER @@ -3253,7 +3253,7 @@ fi install_failed () { local upg_port - [ -n "$ro_upg_port" ] && upg_port="$ro_upg_port" + upg_port="${ro_upg_port:-$upg_port}" if [ -z "$NO_BACKUP" -a -n "$upg_port" ]; then echo ''
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005020328.o423STaw031449>