[Bug 276102] freebsd-update: command gives questionable recommendation which command to run next

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 03 Jan 2024 17:19:55 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276102

            Bug ID: 276102
           Summary: freebsd-update: command gives questionable
                    recommendation which command to run next
           Product: Base System
           Version: 13.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: michaelo@FreeBSD.org

freebsd-update may print something like this:
> To install the downloaded upgrades, run "/usr/sbin/freebsd-update install".
or
> Kernel updates have been installed.  Please reboot and run
> "/usr/sbin/freebsd-update install" again to finish installing updates.

Morespecifically, these:
> $ grep -e '\$0' /usr/sbin/freebsd-update | grep -v basename
>                 echo "Run '$0 install' first."
>                 echo "Run '$0 fetch -F' to proceed anyway."
>                         echo "Run '$0 fetch' first."
>                 echo "Re-run '$0 fetch'."
> before running "$0 install".
>         echo "To install the downloaded upgrades, run \"$0 install\"."
>                         echo "Re-run '$0 fetch'."
> "$0 install" again to finish installing updates.
> installed from the ports tree) and then run "$0 install"
>         echo "Run '$0 install' to proceed." 

The problem with these recommendations is that if freebsd-update is started
with options (e.g., -b, -f, etc.) the copied and pasted recommendationd lead to
incorrect or even broken results.
Consider running:
> freebsd-update -j deblndw013x4v2j -d $(jls -j deblndw013x4v2j -h path | tail -1)/var/db/freebsd-update -f $(jls -j deblndw013x4v2j -h path | tail -1)/etc/freebsd-update.conf -r 13.2-RELEASE upgrade
then
> freebsd-update install
as next command would be wrong.

This might be nit-picking, but not straight forward for some people. It should
either completely replicate the command input or describe rather in prose
rather can providing a copiable command.

-- 
You are receiving this mail because:
You are the assignee for the bug.