From owner-svn-src-user@FreeBSD.ORG Fri Feb 4 00:57:04 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 AA5B01065670; Fri, 4 Feb 2011 00:57:04 +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 98FC28FC15; Fri, 4 Feb 2011 00:57:04 +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 p140v49O064198; Fri, 4 Feb 2011 00:57:04 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p140v4N9064196; Fri, 4 Feb 2011 00:57:04 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201102040057.p140v4N9064196@svn.freebsd.org> From: Doug Barton Date: Fri, 4 Feb 2011 00:57:04 +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: r218245 - 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, 04 Feb 2011 00:57:04 -0000 Author: dougb Date: Fri Feb 4 00:57:04 2011 New Revision: 218245 URL: http://svn.freebsd.org/changeset/base/218245 Log: Add the ability to store the portmaster.rc file in the same directory as the script itself. Switch the test for existence of an rc file from -r to -s Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Fri Feb 4 00:48:41 2011 (r218244) +++ user/dougb/portmaster/portmaster Fri Feb 4 00:57:04 2011 (r218245) @@ -27,10 +27,13 @@ if [ -z "$PM_PARENT_PID" ]; then set -o allexport # Read a global rc file first - [ -r /usr/local/etc/portmaster.rc ] && . /usr/local/etc/portmaster.rc + [ -s /usr/local/etc/portmaster.rc ] && . /usr/local/etc/portmaster.rc + + # Allow the config file to be stored with the script + [ -s "${0%/*}/portmaster.rc" ] && . ${0%/*}/portmaster.rc # Read a local one next, and allow the command line to override - [ -r "$HOME/.portmasterrc" ] && . $HOME/.portmasterrc + [ -s "$HOME/.portmasterrc" ] && . $HOME/.portmasterrc set +o allexport my_environment=`set`