From owner-svn-ports-head@freebsd.org Tue Apr 5 19:50:25 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 214C2B04FFB; Tue, 5 Apr 2016 19:50:25 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED4991BB9; Tue, 5 Apr 2016 19:50:24 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u35JoOYk025261; Tue, 5 Apr 2016 19:50:24 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u35JoNWJ025256; Tue, 5 Apr 2016 19:50:23 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201604051950.u35JoNWJ025256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Tue, 5 Apr 2016 19:50:23 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r412585 - in head/security/openvas-manager: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2016 19:50:25 -0000 Author: tijl Date: Tue Apr 5 19:50:23 2016 New Revision: 412585 URL: https://svnweb.freebsd.org/changeset/ports/412585 Log: Port stat(1) calls in several scripts. PR: 208556 Submitted by: kwinkelman@mcclatchy.com MFH: 2016Q2 Added: head/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in (contents, props changed) head/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in (contents, props changed) head/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in (contents, props changed) head/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in (contents, props changed) Modified: head/security/openvas-manager/Makefile Modified: head/security/openvas-manager/Makefile ============================================================================== --- head/security/openvas-manager/Makefile Tue Apr 5 19:46:18 2016 (r412584) +++ head/security/openvas-manager/Makefile Tue Apr 5 19:50:23 2016 (r412585) @@ -2,7 +2,7 @@ PORTNAME= openvas-manager PORTVERSION= 6.0.8 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security MASTER_SITES= http://wald.intevation.org/frs/download.php/2295/ Added: head/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/openvas-manager/files/patch-tools+greenbone-certdata-sync.in Tue Apr 5 19:50:23 2016 (r412585) @@ -0,0 +1,29 @@ +--- tools/greenbone-certdata-sync.in.orig 2015-12-08 07:09:31 UTC ++++ tools/greenbone-certdata-sync.in +@@ -643,7 +643,7 @@ update_cert_db() { + then + for certfile in `ls $CERT_DIR/CB-K*.xml` + do +- filedate=`stat -c "%Y" $certfile | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" $certfile | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then +@@ -677,7 +677,7 @@ update_cert_db() { + then + for certfile in `ls $CERT_DIR/dfn-cert-*.xml` + do +- filedate=`stat -c "%Y" $certfile | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" $certfile | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then +@@ -886,7 +886,7 @@ then + exit 1 + fi + +-if [ $(id -u) -ne $(stat -c %u $CERT_DB) ] ++if [ $(id -u) -ne $(stat -f %u $CERT_DB) ] + then + log_err "Not synchronizing or updating the database since the current user is not the owner of the database." + echo "Not synchronizing or updating the database since the current user is not the owner of the database." Added: head/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/openvas-manager/files/patch-tools+greenbone-scapdata-sync.in Tue Apr 5 19:50:23 2016 (r412585) @@ -0,0 +1,60 @@ +--- tools/greenbone-scapdata-sync.in.orig 2015-12-08 07:09:31 UTC ++++ tools/greenbone-scapdata-sync.in +@@ -962,7 +962,7 @@ update_scap_db_private () { + then + for ovalfile in $oval_files_sorted_private + do +- filedate=`stat -c "%Y" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] || [ 1 = "$REBUILD_OVAL" ] + then +@@ -1090,12 +1090,12 @@ update_scap_db() { + CPEBASE="$SCAP_DIR/official-cpe-dictionary_v2.2.xml" + if [ -e $CPEBASE ] + then +- filedate=`stat -c "%Y" "$CPEBASE" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$CPEBASE" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then + log_info "Updating CPEs" +- filesize=`stat -c "%s" "$CPEBASE"` ++ filesize=`stat -f "%z" "$CPEBASE"` + if [ "0" -ne "$SPLIT_PART_SIZE" ] && [ "$filesize" -gt $(($SPLIT_PART_SIZE * 1024)) ] + then + log_info "File is larger than ${SPLIT_PART_SIZE}k. Splitting into multiple parts" +@@ -1152,13 +1152,13 @@ update_scap_db() { + then + for cvefile in `ls $SCAP_DIR/nvdcve-2.0-*.xml` + do +- filedate=`stat -c "%Y" "$cvefile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$cvefile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then + log_info "Updating $cvefile" + +- filesize=`stat -c "%s" "$cvefile"` ++ filesize=`stat -f "%z" "$cvefile"` + if [ "0" -ne "$SPLIT_PART_SIZE" ] && [ "$filesize" -gt $(($SPLIT_PART_SIZE * 1024)) ] + then + log_info "File is larger than ${SPLIT_PART_SIZE}k. Splitting into multiple parts" +@@ -1228,7 +1228,7 @@ update_scap_db() { + + for ovalfile in $oval_files_sorted + do +- filedate=`stat -c "%Y" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] || [ 1 = "$REBUILD_OVAL" ] + then +@@ -1469,7 +1469,7 @@ then + exit 1 + fi + +-if [ $(id -u) -ne $(stat -c %u $SCAP_DB) ] ++if [ $(id -u) -ne $(stat -f %u $SCAP_DB) ] + then + log_err "Not synchronizing or updating the database since the current user is not the owner of the database." + echo "Not synchronizing or updating the database since the current user is not the owner of the database." Added: head/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/openvas-manager/files/patch-tools+openvas-certdata-sync.in Tue Apr 5 19:50:23 2016 (r412585) @@ -0,0 +1,20 @@ +--- tools/openvas-certdata-sync.in.orig 2015-08-03 05:52:10 UTC ++++ tools/openvas-certdata-sync.in +@@ -575,7 +575,7 @@ update_sec_db () { + then + for certfile in `ls $CERT_DIR/CB-K*.xml` + do +- filedate=`stat -c "%Y" $certfile | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" $certfile | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then +@@ -610,7 +610,7 @@ update_sec_db () { + then + for certfile in `ls $CERT_DIR/dfn-cert-*.xml` + do +- filedate=`stat -c "%Y" $certfile | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" $certfile | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then Added: head/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/openvas-manager/files/patch-tools+openvas-scapdata-sync.in Tue Apr 5 19:50:23 2016 (r412585) @@ -0,0 +1,52 @@ +--- tools/openvas-scapdata-sync.in.orig 2015-08-03 05:52:10 UTC ++++ tools/openvas-scapdata-sync.in +@@ -885,7 +885,7 @@ update_sec_db_private () { + then + for ovalfile in $oval_files_sorted_private + do +- filedate=`stat -c "%Y" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] || [ 1 = "$REBUILD_OVAL" ] + then +@@ -1012,13 +1012,13 @@ update_sec_db () { + CPEBASE="$SCAP_DIR/official-cpe-dictionary_v2.2.xml" + if [ -e $CPEBASE ] + then +- filedate=`stat -c "%Y" "$CPEBASE" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$CPEBASE" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then + echo "[i] Updating CPEs" + +- filesize=`stat -c "%s" "$CPEBASE"` ++ filesize=`stat -f "%z" "$CPEBASE"` + if [ "0" -ne "$SPLIT_PART_SIZE" ] && [ "$filesize" -gt $(($SPLIT_PART_SIZE * 1024)) ] + then + echo "[i] File is larger than ${SPLIT_PART_SIZE}k. Splitting into multiple parts" +@@ -1075,13 +1075,13 @@ update_sec_db () { + then + for cvefile in `ls $SCAP_DIR/nvdcve-2.0-*.xml` + do +- filedate=`stat -c "%Y" "$cvefile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$cvefile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] + then + echo "[i] Updating $cvefile" + +- filesize=`stat -c "%s" "$cvefile"` ++ filesize=`stat -f "%z" "$cvefile"` + if [ "0" -ne "$SPLIT_PART_SIZE" ] && [ "$filesize" -gt $(($SPLIT_PART_SIZE * 1024)) ] + then + echo "[i] File is larger than ${SPLIT_PART_SIZE}k. Splitting into multiple parts" +@@ -1151,7 +1151,7 @@ update_sec_db () { + + for ovalfile in $oval_files_sorted + do +- filedate=`stat -c "%Y" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` ++ filedate=`stat -f "%m" "$ovalfile" | cut -d " " -f 1 | tr -d "-"` + filedate=$(( $filedate - ( $filedate % 60 ) )) + if [ $filedate -gt $DB_LASTUPDATE ] || [ 1 = "$REBUILD_OVAL" ] + then