ports/154518: ports-mgmt/portaudit - Add configuration file capabilities

Doug Barton dougb at FreeBSD.org
Sat Feb 5 00:50:10 UTC 2011


>Number:         154518
>Category:       ports
>Synopsis:       ports-mgmt/portaudit - Add configuration file capabilities
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 05 00:50:09 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Doug Barton
>Release:        FreeBSD 8.1-STABLE i386
>Organization:
AAAG
>Environment:
	DNA
>Description:
	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. 

	I haven't documented the local portaudit.conf file since I think
	it will be of limited interest, but I certainly can.

>How-To-Repeat:
	DNA
>Fix:
	Apply the following patch:

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/ports-mgmt/portaudit/Makefile,v
retrieving revision 1.28
diff -u -r1.28 Makefile
--- Makefile	31 Jan 2011 20:17:04 -0000	1.28
+++ Makefile	5 Feb 2011 00:25:06 -0000
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	portaudit
-PORTVERSION=	0.5.16
+PORTVERSION=	0.5.17
 CATEGORIES=	ports-mgmt security
 DISTFILES=
 
Index: files/portaudit-cmd.sh
===================================================================
RCS file: /home/pcvs/ports/ports-mgmt/portaudit/files/portaudit-cmd.sh,v
retrieving revision 1.18
diff -u -r1.18 portaudit-cmd.sh
--- files/portaudit-cmd.sh	31 Jan 2011 20:17:04 -0000	1.18
+++ files/portaudit-cmd.sh	5 Feb 2011 00:25:06 -0000
@@ -33,19 +33,23 @@
 
 portaudit_confs()
 {
-	: ${portaudit_dir="%%DATABASEDIR%%"}
-	: ${portaudit_filename="auditfile.tbz"}
+	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_fetch_cmd:="fetch -1mp"}
 
-	: ${portaudit_sites="http://portaudit.FreeBSD.org/"}
+	: ${portaudit_sites:="http://portaudit.FreeBSD.org/"}
 
 	: ${portaudit_fixed=""}
-
-	if [ -r %%PREFIX%%/etc/portaudit.conf ]; then
-		. %%PREFIX%%/etc/portaudit.conf
-	fi
 }
 
 extract_auditfile()
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list