--- etc/freebsd-update.conf (revision 258471) +++ etc/freebsd-update.conf (working copy) @@ -74,3 +74,7 @@ MergeChanges /etc/ /boot/device.hints # When backing up a kernel also back up debug symbol files? # BackupKernelSymbolFiles no + +# If the new release is the specified value, don't emit an email announcing +# it. (Default: unspecified) +# IgnoreReleases 9.1-RELEASE-p8 --- share/man/man5/freebsd-update.conf.5 (revision 258471) +++ share/man/man5/freebsd-update.conf.5 (working copy) @@ -218,6 +218,13 @@ backup kernel, the .Cm freebsd-update rollback command will recreate the symbol files along with the old kernel. +.It Cm IgnoreReleases +The parameters following this keyword are regular expressions; +if the new release matches one of them, it will be ignored by +.Cm cron . +.Pp +This option can be specified multiple times, and the parameters +accumulate. .El .Sh FILES .Bl -tag -width "/etc/freebsd-update.conf" --- usr.sbin/freebsd-update/freebsd-update.sh (revision 258471) +++ usr.sbin/freebsd-update/freebsd-update.sh (working copy) @@ -88,6 +88,7 @@ EOF CONFIGOPTIONS="KEYPRINT WORKDIR SERVERNAME MAILTO ALLOWADD ALLOWDELETE KEEPMODIFIEDMETADATA COMPONENTS IGNOREPATHS UPDATEIFUNMODIFIED BASEDIR VERBOSELEVEL TARGETRELEASE STRICTCOMPONENTS MERGECHANGES + IGNORERELEASE IDSIGNOREPATHS BACKUPKERNEL BACKUPKERNELDIR BACKUPKERNELSYMBOLFILES" # Set all the configuration options to "". @@ -217,6 +218,13 @@ config_Components () { done } +# Add to the list of releases updates to will be ignored. +config_IgnoreReleases () { + for C in $@; do + IGNORERELEASE="${IGNORERELEASE} ${C}" + done +} + # Add to the list of paths under which updates will be ignored. config_IgnorePaths () { for C in $@; do @@ -2086,6 +2094,21 @@ fetch_run () { fetch_warn_eol || return 1 } +# If the available release is in IgnoreReleases, return true. +# Else, return false. +cron_suppress_mail() { + TMPFILE=$1 + if grep -q "No updates needed" ${TMPFILE}; then + return 0 + fi + for X in ${IGNORERELEASE}; do + if echo "${RELNUM}-p${RELPATCHNUM}" | grep -q "${X}"; then + return 0 + fi + done + return 1 +} + # If StrictComponents is not "yes", generate a new components list # with only the components which appear to be installed. upgrade_guess_components () { @@ -3199,7 +3222,7 @@ cmd_cron () { TMPFILE=`mktemp /tmp/freebsd-update.XXXXXX` || exit 1 if ! fetch_run >> ${TMPFILE} || - ! grep -q "No updates needed" ${TMPFILE} || + ! cron_suppress_mail ${TMPFILE} || [ ${VERBOSELEVEL} = "debug" ]; then mail -s "`hostname` security updates" ${MAILTO} < ${TMPFILE} fi