summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-10-27 00:32:46 +0200
committerDan McGee <dan@archlinux.org>2011-10-27 00:32:46 +0200
commit8a9ce12a27970beb644952a83d27f54d1d7f751a (patch)
tree581a70585ce3c7a2b5f336d4cf4301d5c20ee7e6 /test
parent5c1885b55eae870a10c91793d05a74d74a075e83 (diff)
downloadpacman-8a9ce12a27970beb644952a83d27f54d1d7f751a.tar.gz
pacman-8a9ce12a27970beb644952a83d27f54d1d7f751a.tar.xz
Fix issues with replacing unowned symlinks
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>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/tests/symlink010.py2
-rw-r--r--test/pacman/tests/symlink011.py2
2 files changed, 0 insertions, 4 deletions
diff --git a/test/pacman/tests/symlink010.py b/test/pacman/tests/symlink010.py
index 8c80dbc9..a1e562e1 100644
--- a/test/pacman/tests/symlink010.py
+++ b/test/pacman/tests/symlink010.py
@@ -22,5 +22,3 @@ self.addrule("FILE_EXIST=usr/bin/otherprog")
self.addrule("FILE_TYPE=usr/bin/myprog|file")
self.addrule("FILE_TYPE=usr/bin/myprogsuffix|link")
self.addrule("FILE_TYPE=usr/bin/otherprog|file")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/symlink011.py b/test/pacman/tests/symlink011.py
index 85101725..93cd9ddf 100644
--- a/test/pacman/tests/symlink011.py
+++ b/test/pacman/tests/symlink011.py
@@ -22,5 +22,3 @@ self.addrule("FILE_EXIST=usr/bin/otherprog")
self.addrule("FILE_TYPE=usr/bin/myprog|file")
self.addrule("FILE_TYPE=usr/bin/myprogsuffix|link")
self.addrule("FILE_TYPE=usr/bin/otherprog|file")
-
-self.expectfailure = True