Adjust recognize-shared-libraries regex to avoid matching symlinks to

shared libraries.

This fixes a problem which resulted in 6.x->7.x upgrades having the
/usr/lib/libpthread.so -> libthr.so symlink missing; what happened was
that the old libpthread.so symlink pointed to /lib/libpthread.so.2 --
which matched the "/lib/*\.so\.[0-9]+" regex -- but the new symlink
didn't, so FreeBSD Update got confused and deleted the symlink as part
of its "remove old shared libraries" step.

To recreate the symlink (which I understand is necessary for ports like
KDE to build) on a 7.x system which FreeBSD Update upgraded from 6.x:
# ln -s libthr.so /usr/lib/libpthread.so

Reported by:	Dmitry RCL Rekman
Help diagnosing bug from:	kris
MFC after:	7 days
This commit is contained in:
cperciva 2008-03-25 11:31:16 +00:00
parent e2f2131976
commit e212b28cc6

View File

@ -2511,14 +2511,14 @@ Kernel updates have been installed. Please reboot and run
if ! [ -f $1/worlddone ]; then
# Install new shared libraries next
grep -vE '^/boot/' $1/INDEX-NEW |
grep -E '/lib/.*\.so\.[0-9]+' > INDEX-NEW
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 '/lib/.*\.so\.[0-9]+' > INDEX-OLD
grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
grep -vE '^/boot/' $1/INDEX-NEW |
grep -vE '/lib/.*\.so\.[0-9]+' > INDEX-NEW
grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
install_from_index INDEX-NEW || return 1
install_delete INDEX-OLD INDEX-NEW || return 1
@ -2539,11 +2539,11 @@ Kernel updates have been installed. Please reboot and run
# Do we need to ask the user to portupgrade now?
grep -vE '^/boot/' $1/INDEX-NEW |
grep -E '/lib/.*\.so\.[0-9]+' |
grep -E '/lib/.*\.so\.[0-9]+\|' |
cut -f 1 -d '|' |
sort > newfiles
if grep -vE '^/boot/' $1/INDEX-OLD |
grep -E '/lib/.*\.so\.[0-9]+' |
grep -E '/lib/.*\.so\.[0-9]+\|' |
cut -f 1 -d '|' |
sort |
join -v 1 - newfiles |
@ -2563,9 +2563,9 @@ again to finish installing updates.
# Remove old shared libraries
grep -vE '^/boot/' $1/INDEX-NEW |
grep -E '/lib/.*\.so\.[0-9]+' > INDEX-NEW
grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
grep -vE '^/boot/' $1/INDEX-OLD |
grep -E '/lib/.*\.so\.[0-9]+' > INDEX-OLD
grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
install_delete INDEX-OLD INDEX-NEW || return 1
# Remove temporary files
@ -2631,35 +2631,35 @@ rollback_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]+' |
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]+' |
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
grep -vE '^/boot/' $1/INDEX-OLD |
grep -vE '/lib/.*\.so\.[0-9]+' > INDEX-OLD
grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
grep -vE '^/boot/' $1/INDEX-NEW |
grep -vE '/lib/.*\.so\.[0-9]+' > INDEX-NEW
grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
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]+' |
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
grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
grep -vE '^/boot/' $1/INDEX-NEW |
grep -E '/lib/.*\.so\.[0-9]+' > INDEX-NEW
grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
install_delete INDEX-NEW INDEX-OLD || return 1
# Deal with kernel files