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

(cherry picked from commit 6b27e1f2ea)
This commit is contained in:
Ed Maste 2023-09-29 11:28:35 -04:00
parent f8f15d7436
commit 2b79df0ad9

View file

@ -3196,6 +3196,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 |