svn commit: r218245 - user/dougb/portmaster
Doug Barton
dougb at FreeBSD.org
Fri Feb 4 00:57:04 UTC 2011
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`
More information about the svn-src-user
mailing list