Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test/pacman/tests/symlink011.py
AgeCommit message (Collapse)Author
2011-10-26Fix issues with replacing unowned symlinksDan McGee
There aretwo seperate issues in the same block of file conflict checking code here: 1) If realpath errored, such as when a symlink was broken, we would call 'continue' rather than simply exit this particular method of resolution. This was likely just a copy-paste mistake as the previous resolving steps all use loops where continue makes sense. Refactor the check so we only proceed if realpath is successful, and continue with the rest of the checks either way. 2) The real problem this code was trying to solve was canonicalizing path component (e.g., directory) symlinks. The final component, if not a directory, should not be handled at all in this loop. Add a !S_ISLNK() condition to the loop so we only call this for real files. There are few other small cleanups to the debug messages that I made while debugging this problem- we don't need to keep printing the file name, and ensure every block that sets resolved_conflict to true prints a debug message so we know how it was resolved. This fixes the expected failures from symlink010.py and symlink011.py, while still ensuring the fix for fileconflict007.py works. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-10-26Add some unowned symlink replacement testsDan McGee
These should all prevent installation, and yet two of the three tests currently fail. Not good. The best way to see what is going on here is to diff the three new tests side by side- there is only a small difference between the three tests, and that is in the destination of the symlink in question that should never be overwritten. symlink010.py: myprogsuffix -> myprog symlink011.py: myprogsuffix -> broken symlink012.py: myprogsuffix -> otherprog Signed-off-by: Dan McGee <dan@archlinux.org>