diff options
author | cperciva <cperciva@FreeBSD.org> | 2007-11-16 13:57:41 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2007-11-16 13:57:41 +0000 |
commit | fbef05e0b83973e1109a0eccb89811fa7922e85d (patch) | |
tree | 7dea4f93434c020ac6246314eb1c6d5feef799d9 /usr.sbin/freebsd-update/freebsd-update.sh | |
parent | efed1ad4e46e0c79bf8e299ecfe54b550aa3964f (diff) | |
download | FreeBSD-src-fbef05e0b83973e1109a0eccb89811fa7922e85d.zip FreeBSD-src-fbef05e0b83973e1109a0eccb89811fa7922e85d.tar.gz |
Fix "freebsd-update rollback" applied to minor-version upgrades: Old
shared object files which have the same name as currently-installed
shared object files should be reinstalled after binaries are rolled
back. The order for rolling back updates is therefore
1. Install any old shared object files which can be installed without
overwriting a new shared object file.
2. Rollback everything which isn't a shared object or kernel file.
3. Rollback any shared object files which we didn't deal with in (1).
4. Rollback to the old kernel.
Bug reported by: Jan Henrik Sylvester
MFC after: 3 days
Diffstat (limited to 'usr.sbin/freebsd-update/freebsd-update.sh')
-rw-r--r-- | usr.sbin/freebsd-update/freebsd-update.sh | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index cccb0e2..fc907e0 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -2628,9 +2628,16 @@ rollback_setup_rollback () { # Install old files, delete new files, and update linker.hints rollback_files () { - # Install old shared library files + # Install old shared library files which don't have the same path as + # a new shared library file. + grep -vE '^/boot/' $1/INDEX-NEW | + grep -E '/lib/.*\.so\.[0-9]+' | + cut -f 1 -d '|' | + sort > INDEX-NEW.libs.flist grep -vE '^/boot/' $1/INDEX-OLD | - grep -E '/lib/.*\.so\.[0-9]+' > INDEX-OLD + grep -E '/lib/.*\.so\.[0-9]+' | + sort -k 1,1 -t '|' - | + join -t '|' -v 1 - INDEX-NEW.libs.flist > INDEX-OLD install_from_index INDEX-OLD || return 1 # Deal with files which are neither kernel nor shared library @@ -2641,6 +2648,13 @@ rollback_files () { install_from_index INDEX-OLD || return 1 install_delete INDEX-NEW INDEX-OLD || return 1 + # Install any old shared library files which we didn't install above. + grep -vE '^/boot/' $1/INDEX-OLD | + grep -E '/lib/.*\.so\.[0-9]+' | + sort -k 1,1 -t '|' - | + join -t '|' - INDEX-NEW.libs.flist > INDEX-OLD + install_from_index INDEX-OLD || return 1 + # Delete unneeded shared library files grep -vE '^/boot/' $1/INDEX-OLD | grep -E '/lib/.*\.so\.[0-9]+' > INDEX-OLD |