summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libalpm/conflict.c13
-rw-r--r--pactest/tests/fileconflict007.py17
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index c4c57cb0..a6d50d4f 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -531,6 +531,19 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans,
free(dir);
}
+ if(!resolved_conflict && dbpkg) {
+ char *rpath = calloc(PATH_MAX+1, sizeof(char));
+ if(!realpath(path, rpath)) {
+ free(rpath);
+ continue;
+ }
+ char *filestr = rpath + strlen(handle->root);
+ if(alpm_list_find_str(alpm_pkg_get_files(dbpkg),filestr)) {
+ resolved_conflict = 1;
+ }
+ free(rpath);
+ }
+
if(!resolved_conflict) {
_alpm_log(PM_LOG_DEBUG, "file found in conflict: %s\n", path);
conflicts = add_fileconflict(conflicts, PM_FILECONFLICT_FILESYSTEM,
diff --git a/pactest/tests/fileconflict007.py b/pactest/tests/fileconflict007.py
new file mode 100644
index 00000000..7e6d85ef
--- /dev/null
+++ b/pactest/tests/fileconflict007.py
@@ -0,0 +1,17 @@
+self.description = "Fileconflict with symlinks (klibc case)"
+
+lp = pmpkg("pkg")
+lp.files = ["dir/realdir/",
+ "dir/symdir -> realdir",
+ "dir/realdir/file"]
+self.addpkg2db("local", lp)
+
+p = pmpkg("pkg", "1.0-2")
+p.files = ["dir/symdir/file"]
+self.addpkg(p)
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_EXIST=pkg")
+self.addrule("PKG_VERSION=pkg|1.0-2")