etcupdate: Remove the old pre-world tree when rotating for -p.

This fixes a bug in an earlier change to move tree rotation to
the end of the update where the step to make room for the new
preworld tree was deleting the old "current" tree instead of
the old "preworld" tree.

Reported by:	olivier, dhw
Fixes:		0611aec3cf
MFC after:	2 weeks
This commit is contained in:
John Baldwin 2021-04-23 09:40:04 -07:00
parent d500a85e64
commit b0df36580d

View File

@ -1644,7 +1644,7 @@ EOF
if [ -z "$preworld" ]; then
panic "New tree should be rotated to old"
fi
if ! remove_tree $old; then
if ! remove_tree $new; then
echo "Unable to remove previous pre-world tree."
exit 1
fi