ports/162644: ports-mgmt/portaudit omit fetch output unless verbose

root at claimlynx.com root at claimlynx.com
Thu Nov 17 16:40:11 UTC 2011


>Number:         162644
>Category:       ports
>Synopsis:       ports-mgmt/portaudit omit fetch output unless verbose
>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:   Thu Nov 17 16:40:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Johnson
>Release:        FreeBSD 8.2-RELEASE-p3 amd64
>Organization:
ClaimLynx, Inc.
>Environment:
System: FreeBSD jaguar-1.claimlynx.com 8.2-RELEASE-p3 FreeBSD 8.2-RELEASE-p3 #10: Wed Sep 28 14:57:48 CDT 2011 root at jaguar-2.claimlynx.com:/usr/obj/usr/src/sys/GENERIC-CARP amd64


>Description:
	I have made a small modification to the portaudit script in the ports-mgmt/portaudit port that I think would be useful upstream. In the current version of portaudit, the fetch command that retrieves the database does not run quietly unless portaudit is run quietly. As a result, on a fully updated system, this script generates output every time it is run (and the database updated). In my case, I run portaudit (via cron) against a number of pxe FreeBSD images, rather than the typical periodic script. This results in me getting an email from the cron job every run, with a single line about the auditfile download.

	My patch changes the behavior of portaudit slightly, so that fetch is run quietly, unless portaudit is run with verbose. Since portaudit checks the result of the fetch anyways, it seems redundant to have fetch generate anything unless the user really wants it.
>How-To-Repeat:
	Run portaudit on a crontab.
>Fix:

--- /usr/local/sbin/portaudit	2011-11-07 10:23:51.000000000 -0600
+++ /tmp/portaudit	2011-11-17 07:55:39.000000000 -0600
@@ -1,5 +1,3 @@
-#!/bin/sh -efu
-#
 # Copyright (c) 2004 Oliver Eikemeier. All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -45,7 +43,7 @@
 	: ${portaudit_filename:="auditfile.tbz"}
 
 	: ${portaudit_fetch_env=""}
-	: ${portaudit_fetch_cmd:="fetch -1mp"}
+	: ${portaudit_fetch_cmd:="fetch -1mpq"}
 
 	: ${portaudit_sites:="http://portaudit.FreeBSD.org/"}
 
@@ -396,8 +394,8 @@
 fi
 
 if $opt_fetch; then
-	if $opt_quiet ; then
-		portaudit_fetch_cmd="${portaudit_fetch_cmd} -q"
+	if $opt_verbose ; then
+		portaudit_fetch_cmd=`echo ${portaudit_fetch_cmd} | sed -E 's/\-q//'`
 	fi
 
 	if ! fetch_auditfile; then

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list