Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Feb 2011 00:57:04 +0000 (UTC)
From:      Doug Barton <dougb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r218245 - user/dougb/portmaster
Message-ID:  <201102040057.p140v4N9064196@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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`



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102040057.p140v4N9064196>