I just upgraded from 5.1 to 5.2 and encountered the non-trivial problem of having the symbolic links /var/lib -> /usr/links/var/lib /var/tmp -> /usr/links/var/tmp which caused the upgrade to fail (could not find the rpm database). Although the failure was caused by having installed *absolute* links (my fault), it would be nice, if the installer would work around this (e.g by doing chroot). Changing the links to relative links solved the problem. Maybe this should be done automatically by the installer? At least the installer should be able to detect the problem and give a proper error message. Cheers, Peter.
This has been assigned to a developer for further review.
Fixing this would be very hard - involving walking trees and resolving symlinks. I never use absolute symlinks to avoid problems with chroot()'ed operations.
Actually the big problem was that `rpm' could not find the rpm database. Maybe it is possible to use the `--root' switch for this? An absolute link should than point to the right place. For doing this, you probably just have to change in the file upgrade.c: :::line 395::: int ugFindUpgradePackages(struct pkgSet *psp, char *installRoot) { rpmdb db; struct hash_table *hashTable; logDebugMessage(("ugFindUpgradePackages() ...")); rpmReadConfigFiles(NULL, NULL, NULL, 0); [[[ here you should insert something to find out what `installRoot' should be, e.g. by reading the possible symbolic link info of var, lib, and rpm to construct a new unsymbolic path ]]] if (rpmdbOpen(installRoot, &db, O_CREAT | O_RDWR, 0644)) { logMessage("failed opening %s/var/lib/rpm/packages.rpm", installRoot); [[[ here you could add a comment, that this error may be caused by an absolute link in the path /var/lib/rpm ]]] return(INST_ERROR); } ---------------------Just a comment: BTW, there are some rpm files which do not install with relative links. One simple example is `xbill'. It installs symbolic links like: cd /var/lib/games/xbill ln -s ../../../../usr/lib/xbill/bitmaps bitmaps Now, if /var/lib is a relative symbolic link, e.g.: cd /var ln -s ../usr/links/var/lib lib (say a user wants to keep all modifications at a special place /usr/links) than the xbill.rpm installs without errors but the bitmaps link is dangling. It works, however, if the /var/lib link is in the same depth, e.g.: cd /var ln -s ../usr/varlib lib ---------------------- Best Wishes, Peter.
/var/lib and /tmp must be relative links; fixing this would be quite involved and isn't worth the trouble