When installing updates, install new directories first and remove old

directories last.

This is generally handled by the fact that the list of filesystem objects
is sorted, but this sorting is broken by code which moves .so files ahead
(so that they're present before any binaries which use them)... that code
also moved .so files ahead of directories, which is a problem for upgrading
to 10.0 where there's a new directory containing new .so files.

Errata Notice Candidate.
This commit is contained in:
Colin Percival 2013-10-16 18:36:53 +00:00
parent 49cc03da31
commit cd1ab2280c

View File

@ -2814,15 +2814,23 @@ Kernel updates have been installed. Please reboot and run
# If we haven't already dealt with the world, deal with it.
if ! [ -f $1/worlddone ]; then
# Create any necessary directories first
grep -vE '^/boot/' $1/INDEX-NEW |
grep -E '^[^|]+\|d\|' > INDEX-NEW
install_from_index INDEX-NEW || return 1
# Install new shared libraries next
grep -vE '^/boot/' $1/INDEX-NEW |
grep -vE '^[^|]+\|d\|' |
grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
install_from_index INDEX-NEW || return 1
# Deal with everything else
grep -vE '^/boot/' $1/INDEX-OLD |
grep -vE '^[^|]+\|d\|' |
grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
grep -vE '^/boot/' $1/INDEX-NEW |
grep -vE '^[^|]+\|d\|' |
grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
install_from_index INDEX-NEW || return 1
install_delete INDEX-OLD INDEX-NEW || return 1
@ -2868,11 +2876,20 @@ again to finish installing updates.
# Remove old shared libraries
grep -vE '^/boot/' $1/INDEX-NEW |
grep -vE '^[^|]+\|d\|' |
grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
grep -vE '^/boot/' $1/INDEX-OLD |
grep -vE '^[^|]+\|d\|' |
grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
install_delete INDEX-OLD INDEX-NEW || return 1
# Remove old directories
grep -vE '^/boot/' $1/INDEX-OLD |
grep -E '^[^|]+\|d\|' > INDEX-OLD
grep -vE '^/boot/' $1/INDEX-OLD |
grep -E '^[^|]+\|d\|' > INDEX-OLD
install_delete INDEX-OLD INDEX-NEW || return 1
# Remove temporary files
rm INDEX-OLD INDEX-NEW
}