freebsd-update: for rollback, first create directories

rollback_files() tried to install files before creating the directories
for those files.  In some cases this is due to special handling to
install certain classes of files earlier than others.

Just create all directories up front when performing rollback.

PR:		273950
Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42020
This commit is contained in:
Ed Maste 2023-09-29 11:28:35 -04:00
parent c0f5244316
commit 6b27e1f2ea

View file

@ -3191,6 +3191,11 @@ rollback_setup_rollback () {
# Install old files, delete new files, and update linker.hints
rollback_files () {
# Create directories first. They may be needed by files we will
# install in subsequent steps (PR273950).
awk -F \| '{if ($2 == "d") print }' $1/INDEX-OLD > INDEX-OLD
install_from_index INDEX-OLD || return 1
# Install old shared library files which don't have the same path as
# a new shared library file.
grep -vE '^/boot/' $1/INDEX-NEW |