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,28 @@ done fetch_tagsanity || return 1 + # By comparing files tag and tag.new fetch_run can detect that + # there are no updates upstream and that there is no need for + # further processing, expediting fetch_run. fetch_run can only + # be expedited subsequent to an uninterrupted fetch_run. + if [ ! -f fetch_run.pending ] && [ -f tag.new -a -f tag ] && + [ "$BASEDIR" = "/" ] && cmp -s tag.new tag; then + echo "No updates are available to fetch." + if [ -f fetch_create_manifest.out ]; then + echo "Updates available to install." + echo + cat fetch_create_manifest.out | ${PAGER} + else + echo + echo -n "No updates needed to update system to " + echo "${RELNUM}-p${RELPATCHNUM}." + fi + rm -f tag.new + return 0 + fi + touch fetch_run.pending || return 1 + rm -f fetch_create_manifest.out + # Fetch the latest INDEX-NEW and INDEX-OLD files. fetch_metadata INDEX-NEW INDEX-OLD || return 1 @@ -2254,10 +2276,13 @@ # Create and populate install manifest directory; and report what # updates are available. - fetch_create_manifest || return 1 + fetch_create_manifest > fetch_create_manifest.out || return 1 + cat fetch_create_manifest.out # 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 @@ -3125,6 +3150,8 @@ # Rearrange bits to allow the installed updates to be rolled back install_setup_rollback + rm -f fetch_create_manifest.out + echo " done." } @@ -3192,6 +3219,7 @@ # Actually rollback updates rollback_run () { + rm -f tag echo -n "Uninstalling updates..." # If there are updates waiting to be installed, remove them; we