aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2020-09-19 02:15:56 +0000
committerColin Percival <cperciva@FreeBSD.org>2020-09-19 02:15:56 +0000
commit9a63bbc93e574d1f93c1583a5f51ae3bbace476a (patch)
tree95e0b1fa65b1b8391321107fa84c145219642959 /usr.sbin
parenteef96401a91f570f476b15f1508b1884037a2c2b (diff)
downloadsrc-9a63bbc93e574d1f93c1583a5f51ae3bbace476a.tar.gz
src-9a63bbc93e574d1f93c1583a5f51ae3bbace476a.zip
Move finalize_components_config from get_params to cmd_*.
This allows us to redirect its output in cmd_cron, so that the "src component not installed, skipped" message will be treated the same way as other output from freebsd-update cron: Sent in an email to root (or other address specified) if there are updates to install, and silenced otherwise. PR: 202492 MFC After: 1 week Differential Revision: https://reviews.freebsd.org/D26432
Notes
Notes: svn path=/head/; revision=365898
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/freebsd-update/freebsd-update.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
index 1e4d5f20d888..ea85bb7c6831 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -3300,12 +3300,12 @@ get_params () {
parse_cmdline $@
parse_conffile
default_params
- finalize_components_config ${COMPONENTS}
}
# Fetch command. Make sure that we're being called
# interactively, then run fetch_check_params and fetch_run
cmd_fetch () {
+ finalize_components_config ${COMPONENTS}
if [ ! -t 0 -a $NOTTYOK -eq 0 ]; then
echo -n "`basename $0` fetch should not "
echo "be run non-interactively."
@@ -3326,6 +3326,7 @@ cmd_cron () {
sleep `jot -r 1 0 3600`
TMPFILE=`mktemp /tmp/freebsd-update.XXXXXX` || exit 1
+ finalize_components_config ${COMPONENTS} >> ${TMPFILE}
if ! fetch_run >> ${TMPFILE} ||
! grep -q "No updates needed" ${TMPFILE} ||
[ ${VERBOSELEVEL} = "debug" ]; then
@@ -3337,6 +3338,7 @@ cmd_cron () {
# Fetch files for upgrading to a new release.
cmd_upgrade () {
+ finalize_components_config ${COMPONENTS}
upgrade_check_params
upgrade_run || exit 1
}
@@ -3344,6 +3346,7 @@ cmd_upgrade () {
# Check if there are fetched updates ready to install.
# Chdir into the working directory.
cmd_updatesready () {
+ finalize_components_config ${COMPONENTS}
# Check if working directory exists (if not, no updates pending)
if ! [ -e "${WORKDIR}" ]; then
echo "No updates are available to install."
@@ -3368,24 +3371,28 @@ cmd_updatesready () {
# Install downloaded updates.
cmd_install () {
+ finalize_components_config ${COMPONENTS}
install_check_params
install_run || exit 1
}
# Rollback most recently installed updates.
cmd_rollback () {
+ finalize_components_config ${COMPONENTS}
rollback_check_params
rollback_run || exit 1
}
# Compare system against a "known good" index.
cmd_IDS () {
+ finalize_components_config ${COMPONENTS}
IDS_check_params
IDS_run || exit 1
}
# Output configuration.
cmd_showconfig () {
+ finalize_components_config ${COMPONENTS}
for X in ${CONFIGOPTIONS}; do
echo $X=$(eval echo \$${X})
done