From dc8cb9de3b495b9edd60bc09c6f6957ec5d3b1c5 Mon Sep 17 00:00:00 2001 From: Remko Lodder Date: Sat, 5 Feb 2011 08:37:06 +0000 Subject: [PATCH] Add some improvements via Doug: This patch changes the order in which the conf file is read vs. when the default variable assignments are made in order to provide the ability to override them in the conf file. It also adds the ability to include a conf file in the same directory as the script. The patch also changes some of the = assignments to := where having a null setting by mistake would be fatal. The use case for these changes is the ability to "package" all of the elements together in one place for use on multiple systems that can all mount the same central location. PR: 154518 Submitted by: dougb Hat: secteam Feature safe: yes --- ports-mgmt/portaudit/Makefile | 2 +- ports-mgmt/portaudit/files/portaudit-cmd.sh | 24 ++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ports-mgmt/portaudit/Makefile b/ports-mgmt/portaudit/Makefile index 9cd56096b824..017c0b60cafe 100644 --- a/ports-mgmt/portaudit/Makefile +++ b/ports-mgmt/portaudit/Makefile @@ -6,7 +6,7 @@ # PORTNAME= portaudit -PORTVERSION= 0.5.16 +PORTVERSION= 0.5.17 CATEGORIES= ports-mgmt security DISTFILES= diff --git a/ports-mgmt/portaudit/files/portaudit-cmd.sh b/ports-mgmt/portaudit/files/portaudit-cmd.sh index b5c71f49fcf2..71d60ea7a94c 100644 --- a/ports-mgmt/portaudit/files/portaudit-cmd.sh +++ b/ports-mgmt/portaudit/files/portaudit-cmd.sh @@ -33,19 +33,23 @@ portaudit_confs() { - : ${portaudit_dir="%%DATABASEDIR%%"} - : ${portaudit_filename="auditfile.tbz"} - - : ${portaudit_fetch_env=""} - : ${portaudit_fetch_cmd="fetch -1mp"} - - : ${portaudit_sites="http://portaudit.FreeBSD.org/"} - - : ${portaudit_fixed=""} - if [ -r %%PREFIX%%/etc/portaudit.conf ]; then . %%PREFIX%%/etc/portaudit.conf fi + + if [ -r "${0%/*}/portaudit.conf" ]; then + . ${0%/*}/portaudit.conf + fi + + : ${portaudit_dir:="%%DATABASEDIR%%"} + : ${portaudit_filename:="auditfile.tbz"} + + : ${portaudit_fetch_env=""} + : ${portaudit_fetch_cmd:="fetch -1mp"} + + : ${portaudit_sites:="http://portaudit.FreeBSD.org/"} + + : ${portaudit_fixed=""} } extract_auditfile()