From owner-svn-src-user@FreeBSD.ORG Sun Apr 10 18:36:25 2011 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 286E81065675; Sun, 10 Apr 2011 18:36:25 +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 191398FC26; Sun, 10 Apr 2011 18:36:25 +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 p3AIaOvw056101; Sun, 10 Apr 2011 18:36:24 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p3AIaOGV056099; Sun, 10 Apr 2011 18:36:24 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201104101836.p3AIaOGV056099@svn.freebsd.org> From: Doug Barton Date: Sun, 10 Apr 2011 18:36:24 +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: r220528 - 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: Sun, 10 Apr 2011 18:36:25 -0000 Author: dougb Date: Sun Apr 10 18:36:24 2011 New Revision: 220528 URL: http://svn.freebsd.org/changeset/base/220528 Log: More fixes to --index-only, with or without a ports tree present, including better handling of --index-only in the rc file. * Don't do the work of handling the INDEX file if we won't need it anyway (-l, --list-origins, -e, -s) * Reorganize the final check of $pd (PORTSDIR) to properly handle the various combinations * Apply the same fix for $portsdir in -o that we did for multiport() * Since --check-depends now works with --index-only, update usage() Also: * Add a few more comments to the final fi of some long blocks * In multiport(), set missing=missing to aid debugging * Add some whitespace to the "Installing new +CONTENTS" message * In --clean-packages show the path in the delete prompt for stale packages that are not installed like we do for ones that are * In --check-port-dbdir simplify creation of the list of unique names Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Sun Apr 10 18:35:43 2011 (r220527) +++ user/dougb/portmaster/portmaster Sun Apr 10 18:36:24 2011 (r220528) @@ -385,7 +385,7 @@ usage () { echo '' echo "${0##*/} [-n|y] [--index|--index-only] --clean-packages" echo '' - echo "${0##*/} [-n|y] [-v] --check-depends" + echo "${0##*/} [-n|y] [--index|--index-only] [-v] --check-depends" echo '' echo "${0##*/} [-n|y] [-v] --check-port-dbdir" echo '' @@ -745,7 +745,8 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then fail Package installation support requires FreeBSD 6.4 or newer fi - if [ -n "$PM_INDEX" ]; then + if [ -n "$PM_INDEX" ] && + [ -z "$LIST" -a -z "$LIST_ORIGINS" -a -z "$EXPUNGE" -a -z "$CLEAN_STALE" ]; then if [ -z "$INDEXFILE" ]; then ver=`uname -r` INDEXFILE=INDEX-${ver%%\.*} @@ -818,19 +819,23 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then PM_IPD=$pd fi export PM_IPD - fi + fi # [ -n "$PM_INDEX" ] - if [ -n "$pd" ]; then - export pd + if [ -z "$EXPUNGE" -a -z "$CLEAN_STALE" ]; then + if [ -n "$pd" ]; then + export pd + elif [ -z "$LIST" -a -z "$LIST_ORIGINS" ]; then + fail 'The value of PORTSDIR cannot be empty' + fi else - if [ -n "$EXPUNGE" -o -n "$CLEAN_STALE" ]; then + if [ -n "$pd" ] && [ -d "$pd" ]; then + export pd + else if [ -z "$DONT_SCRUB_DISTFILES" ]; then pm_v "===>>> There is no ports tree, so using -D option" unset ALWAYS_SCRUB_DISTFILES DONT_SCRUB_DISTFILES=Dopt_es; ARGS="-D $ARGS" fi - elif [ -z "$LIST" -a -z "$LIST_PLUS" -a -z "$LIST_ORIGINS" -a -z "$CHECK_DEPENDS" ]; then - fail 'The value of PORTSDIR cannot be empty' fi fi @@ -844,7 +849,7 @@ if [ "$$" -eq "$PM_PARENT_PID" ]; then PM_BUILD_ONLY_LIST=pm_bol export PM_BUILD_ONLY_LIST fi -fi +fi # [ "$$" -eq "$PM_PARENT_PID" ] #=============== Begin functions relevant to --features and main =============== @@ -1045,7 +1050,7 @@ IFS=' check_regular_file $contents [ -n "$PM_VERBOSE" -o -n "$CHECK_DEPENDS" ] && - echo " ===>>> Installing the new +CONTENTS file" + { echo " ===>>> Installing the new +CONTENTS file" ; echo ''; } pm_install_s $new_cont $contents pm_unlink $new_cont } @@ -1311,6 +1316,7 @@ if [ -n "$CLEAN_PACKAGES" ]; then if [ -z "$PM_YES" ]; then if [ ! -d "${pdb}/${pkg_dir}" ]; then echo " ===>>> $pkg_dir is not installed" + echo " ===>>> Path: ${package}" get_answer_yn y " ===>>> Delete stale package: ${package##*/}" case "$?" in 0) echo " ===>>> Deleting $package" @@ -1388,10 +1394,10 @@ IFS=' if [ -z "$PM_INDEX_ONLY" ]; then if [ -n "$pd" ] && [ ! -d "$pd/$origin" ]; then - missing=yes + missing=missing fi else - parse_index $origin name >/dev/null || missing=yes + parse_index $origin name >/dev/null || missing=missing fi if [ -n "$missing" ]; then echo " ===>>> $pd/$origin does not exist" @@ -1432,8 +1438,6 @@ if [ -n "$CHECK_PORT_DBDIR" ]; then for pkg in $pdb/*; do [ -d $pkg ] || continue - unset unique_name - iport=${pkg#$pdb/} origin=`origin_from_pdb $iport` || continue @@ -1447,8 +1451,7 @@ if [ -n "$CHECK_PORT_DBDIR" ]; then echo " ===>>> $pd/$origin does not exist for $pkg" continue fi - unique_name=`make -V UNIQUENAME` - unique_list="${unique_list}${unique_name}:" + unique_list="${unique_list}`make -V UNIQUENAME`:" done echo "===>>> Checking $port_dbdir" @@ -2975,7 +2978,13 @@ if [ -z "$REPLACE_ORIGIN" ]; then fi else portdir="${1#$pd/}" ; portdir="${portdir%/}" - if [ ! -d "$pd/$portdir" ]; then + if [ -z "$PM_INDEX_ONLY" ]; then + [ -d "$pd/$portdir" ] || missing=missing + else + parse_index $portdir name >/dev/null || missing=missing + fi + + if [ -n "$missing" ]; then echo '' echo "===>>> The first argument to -o must be a directory in $pd" echo '' ; no_valid_port