[pacman-dev] [PATCH 3/8] conflict.c: do not ignore symlink<->dir conflicts

Andrew Gregory andrew.gregory.8 at gmail.com
Fri Apr 26 20:00:24 EDT 2013


Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
 lib/libalpm/conflict.c               | 7 -------
 test/pacman/tests/fileconflict001.py | 2 --
 test/pacman/tests/fileconflict007.py | 2 ++
 test/pacman/tests/fileconflict016.py | 2 --
 test/pacman/tests/fileconflict017.py | 2 --
 test/pacman/tests/fileconflict022.py | 2 --
 test/pacman/tests/symlink001.py      | 2 --
 test/pacman/tests/sync701.py         | 2 ++
 8 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index 5e2fa1e..518a2c6 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -514,17 +514,10 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
 			_alpm_log(handle, ALPM_LOG_DEBUG, "checking possible conflict: %s\n", path);
 
 			if(filestr[strlen(filestr) - 1] == '/') {
-				struct stat sbuf;
 				if(S_ISDIR(lsbuf.st_mode)) {
 					_alpm_log(handle, ALPM_LOG_DEBUG, "file is a directory, not a conflict\n");
 					continue;
 				}
-				stat(path, &sbuf);
-				if(S_ISLNK(lsbuf.st_mode) && S_ISDIR(sbuf.st_mode)) {
-					_alpm_log(handle, ALPM_LOG_DEBUG,
-							"file is a symlink to a dir, hopefully not a conflict\n");
-					continue;
-				}
 				/* if we made it to here, we want all subsequent path comparisons to
 				 * not include the trailing slash. This allows things like file ->
 				 * directory replacements. */
diff --git a/test/pacman/tests/fileconflict001.py b/test/pacman/tests/fileconflict001.py
index e1371f8..b1ad5e1 100644
--- a/test/pacman/tests/fileconflict001.py
+++ b/test/pacman/tests/fileconflict001.py
@@ -25,5 +25,3 @@
 self.addrule("!PKG_EXIST=pkg2")
 self.addrule("FILE_EXIST=dir/realdir/realfile")
 self.addrule("!FILE_EXIST=dir/realdir/file")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/fileconflict007.py b/test/pacman/tests/fileconflict007.py
index 7fe65ed..b61ddb4 100644
--- a/test/pacman/tests/fileconflict007.py
+++ b/test/pacman/tests/fileconflict007.py
@@ -16,3 +16,5 @@
 self.addrule("PKG_EXIST=pkg")
 self.addrule("PKG_VERSION=pkg|1.0-2")
 self.addrule("FILE_TYPE=dir/symdir/|dir")
+
+self.expectfailure = True
diff --git a/test/pacman/tests/fileconflict016.py b/test/pacman/tests/fileconflict016.py
index dbcf708..86ddd72 100644
--- a/test/pacman/tests/fileconflict016.py
+++ b/test/pacman/tests/fileconflict016.py
@@ -22,5 +22,3 @@
 self.addrule("PACMAN_RETCODE=1")
 self.addrule("!PKG_EXIST=pkg1")
 self.addrule("!PKG_EXIST=pkg2")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/fileconflict017.py b/test/pacman/tests/fileconflict017.py
index 4b91dc6..3855a93 100644
--- a/test/pacman/tests/fileconflict017.py
+++ b/test/pacman/tests/fileconflict017.py
@@ -24,5 +24,3 @@
 self.addrule("PACMAN_RETCODE=1")
 self.addrule("!PKG_EXIST=pkg1")
 self.addrule("!PKG_EXIST=pkg2")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/fileconflict022.py b/test/pacman/tests/fileconflict022.py
index b3920df..5ff0b53 100644
--- a/test/pacman/tests/fileconflict022.py
+++ b/test/pacman/tests/fileconflict022.py
@@ -16,5 +16,3 @@
 self.addrule("PACMAN_RETCODE=1")
 self.addrule("!PKG_EXIST=foo")
 self.addrule("!PKG_EXIST=bar")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/symlink001.py b/test/pacman/tests/symlink001.py
index f88d0ae..9136551 100644
--- a/test/pacman/tests/symlink001.py
+++ b/test/pacman/tests/symlink001.py
@@ -17,5 +17,3 @@
 self.addrule("!FILE_EXIST=dir/realdir/tmp")
 self.addrule("FILE_TYPE=dir/symdir|link")
 self.addrule("FILE_TYPE=dir/realdir|dir")
-
-self.expectfailure = True
diff --git a/test/pacman/tests/sync701.py b/test/pacman/tests/sync701.py
index 590845f..912c794 100644
--- a/test/pacman/tests/sync701.py
+++ b/test/pacman/tests/sync701.py
@@ -19,3 +19,5 @@
 self.addrule("PKG_VERSION=pkg1|1.0-2")
 self.addrule("PKG_EXIST=pkg2")
 self.addrule("FILE_TYPE=lib|dir")
+
+self.expectfailure = True
-- 
1.8.2.1



More information about the pacman-dev mailing list