From d8c2ab0e6f52d9a790b608c254761ab4888bd547 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Fri, 9 Aug 2013 09:15:40 -0400 Subject: conflict.c: fix directory ownership check * append "/" to directories before searching package file lists * use lstat over stat so symlinks aren't resolved * fix the inverted check for stat's return value Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- test/pacman/tests/fileconflict031.py | 16 ++++++++++++++++ test/pacman/tests/fileconflict032.py | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/pacman/tests/fileconflict031.py create mode 100644 test/pacman/tests/fileconflict032.py (limited to 'test') diff --git a/test/pacman/tests/fileconflict031.py b/test/pacman/tests/fileconflict031.py new file mode 100644 index 00000000..7d381412 --- /dev/null +++ b/test/pacman/tests/fileconflict031.py @@ -0,0 +1,16 @@ +self.description = "Dir->file transition filesystem conflict resolved by removal (with subdirectory)" + +lp1 = pmpkg("foo") +lp1.files = ["foo/bar/"] +self.addpkg2db("local", lp1) + +sp1 = pmpkg("foo", "2-1") +sp1.conflicts = ["foo"] +sp1.files = ["foo"] +self.addpkg2db("sync", sp1) + +self.args = "-S %s" % sp1.name + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=foo|2-1") +self.addrule("FILE_EXIST=foo") diff --git a/test/pacman/tests/fileconflict032.py b/test/pacman/tests/fileconflict032.py new file mode 100644 index 00000000..9a677359 --- /dev/null +++ b/test/pacman/tests/fileconflict032.py @@ -0,0 +1,17 @@ +self.description = "Dir->file transition filesystem conflict resolved by removal (with symlink)" + +self.filesystem = ["baz/quux"] + +lp1 = pmpkg("foo") +lp1.files = ["foo/bar -> ../baz/"] +self.addpkg2db("local", lp1) + +sp1 = pmpkg("foo", "2-1") +sp1.files = ["foo"] +self.addpkg2db("sync", sp1) + +self.args = "-S %s" % sp1.name + +self.addrule("PACMAN_RETCODE=0") +self.addrule("PKG_VERSION=foo|2-1") +self.addrule("FILE_EXIST=foo") -- cgit v1.2.3-70-g09d2