Index: usr.sbin/freebsd-update/freebsd-update.sh =================================================================== --- usr.sbin/freebsd-update/freebsd-update.sh +++ usr.sbin/freebsd-update/freebsd-update.sh @@ -2200,6 +2200,20 @@ done fetch_tagsanity || return 1 + # If there are no updates upstream there is no need for + # further processing, but force (-F) will stiil perform the + # entirity of fetch_run. Only if a prior fetch_run has + # completed in full will fetch then compare the upstream tag + # (tag.new) to the tag on disk and emit "No updates are + # available to fetch." + if [ $FORCEFETCH -eq 0 ] && [ ! -f fetch_run.pending ] && + [ -f tag.new -a -f tag ] && cmp -s tag.new tag; then + echo "No updates are available to fetch." + rm -f tag.new + return 0 + fi + touch fetch_run.pending || return 1 + # Fetch the latest INDEX-NEW and INDEX-OLD files. fetch_metadata INDEX-NEW INDEX-OLD || return 1 @@ -2258,6 +2272,8 @@ # Warn about any upcoming EoL fetch_warn_eol || return 1 + + rm -f fetch_run.pending } # If StrictComponents is not "yes", generate a new components list @@ -3395,7 +3411,7 @@ TMPFILE=`mktemp /tmp/freebsd-update.XXXXXX` || exit 1 finalize_components_config ${COMPONENTS} >> ${TMPFILE} if ! fetch_run >> ${TMPFILE} || - ! grep -q "No updates needed" ${TMPFILE} || + ! grep -q -E "(^No updates are available to fetch\.$|No updates needed)" ${TMPFILE} || [ ${VERBOSELEVEL} = "debug" ]; then mail -s "`hostname` security updates" ${MAILTO} < ${TMPFILE} fi