Date: Tue, 5 Apr 2016 19:50:23 +0000 (UTC) From: Tijl Coosemans <tijl@FreeBSD.org> 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 Message-ID: <201604051950.u35JoNWJ025256@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604051950.u35JoNWJ025256>