When running from cron, do not output the warning that the src component was skipped because the src dist set was not installed
This avoids cron sending an email to the administrator unless there is an actual error
The change itself should work as expected.
I'm not totally convinced that this is the right approach though -- the message is legitimate as the user is indeed configuring something that is not available on the system, so they should fix the configuration instead (and that would also reduce an unneeded check), so if I was you I'd change the message to something like "please remove the src component from your /etc/freebsd-update.conf" and live with it and change the installer to tweak the configuration instead, but that's just a personal preference and I have no strong opinion here.
+1 For a more descriptive and user friendly "src component not installed, skipped" message as long as the cron option is not set. Including the config file to be edited would be helpful. Maybe something like:
FreeBSD src component not installed... skipped. Please remove the src component from /etc/freebsd-update.conf.
I also agree that the installer should modify /etc/freebsd-update.conf when the src component is not selected.
I am not sure if it is the correct way to fix this either, but note that the src component has a special treatment, for some reason, and also, if you install FreeBSD without the src component from the installer, the resulting freebsd-update.conf file still has the src component,