From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Nov 17 16:40:11 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35B981065673 for ; Thu, 17 Nov 2011 16:40:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 133DE8FC0C for ; Thu, 17 Nov 2011 16:40:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pAHGeADh016636 for ; Thu, 17 Nov 2011 16:40:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pAHGeAvn016635; Thu, 17 Nov 2011 16:40:10 GMT (envelope-from gnats) Resent-Date: Thu, 17 Nov 2011 16:40:10 GMT Resent-Message-Id: <201111171640.pAHGeAvn016635@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, root@claimlynx.com Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEBBC1065672 for ; Thu, 17 Nov 2011 16:31:46 +0000 (UTC) (envelope-from root@claimlynx.com) Received: from alcatraz.claimlynx.com (alcatraz.claimlynx.com [216.17.83.245]) by mx1.freebsd.org (Postfix) with ESMTP id 9FE7E8FC13 for ; Thu, 17 Nov 2011 16:31:46 +0000 (UTC) Received: from jaguar-1.claimlynx.com (jaguar-1-red.claimlynx.com [216.17.68.152]) by alcatraz.claimlynx.com (Postfix) with ESMTP id EB19F1CC70 for ; Thu, 17 Nov 2011 10:12:22 -0600 (CST) Received: by jaguar-1.claimlynx.com (Postfix, from userid 0) id DBC3223F038; Thu, 17 Nov 2011 10:12:22 -0600 (CST) Message-Id: <20111117161222.DBC3223F038@jaguar-1.claimlynx.com> Date: Thu, 17 Nov 2011 10:12:22 -0600 (CST) From: root@claimlynx.com To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/162644: ports-mgmt/portaudit omit fetch output unless verbose X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: root@claimlynx.com List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2011 16:40:11 -0000 >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@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: