PR/46757: Check for fetch_pkg_vulnerabilities unset first. trunk
authorchristos <christos@NetBSD.org>
Tue, 31 Jul 2012 09:23:09 +0000
branchtrunk
changeset 212440 b248194dd6cf
parent 212439 7e337edafee6
child 212441 8e56e828a6ec
PR/46757: Check for fetch_pkg_vulnerabilities unset first.
etc/daily
--- a/etc/daily	Tue Jul 31 08:01:30 2012 +0000
+++ b/etc/daily	Tue Jul 31 09:23:09 2012 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: daily,v 1.84 2012/07/30 22:13:38 jdf Exp $
+#	$NetBSD: daily,v 1.85 2012/07/31 09:23:09 christos Exp $
 #	@(#)daily	8.2 (Berkeley) 1/25/94
 #
 
@@ -246,8 +246,8 @@
 	fsck -n -f ${run_fsck_flags} | grep -v '^\*\* Phase'
 fi
 
-echo ""
 if checkyesno run_rdist && [ -f /etc/Distfile ]; then
+	echo ""
 	echo "Running rdist:"
 	if [ -d /var/log/rdist ]; then
 		logf="$(date +%Y.%b.%d)"
@@ -260,13 +260,13 @@
 if pkg_info ${_compat_K_flag} -q -E '*'; then
 	echo ""
 	echo "Fetching package vulnerabilities database:"
-	if checkyesno fetch_pkg_vulnerabilities; then
-		( umask 022 && pkg_admin ${_compat_K_flag} \
-		    fetch-pkg-vulnerabilities -u )
-	elif [ -z "$fetch_pkg_vulnerabilities" ]; then
+	if [ -z "fetch_pkg_vulnerabilities" ]; then
 		echo "fetch_pkg_vulnerabilities is not set in daily.conf(5)."
 		echo "You should set it to YES to enable vulnerability checks"
 		echo "or set it to NO to get rid of this warning."
+	elif checkyesno fetch_pkg_vulnerabilities; then
+		( umask 022 && pkg_admin ${_compat_K_flag} \
+		    fetch-pkg-vulnerabilities -u )
 	fi
 fi