From e378170c2555b656ef87715d8284d038037ced5f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 27 Jun 2011 09:07:06 -0500 Subject: Ensure a file can be replaced by a directory This addresses FS#24904. In a normal upgrade case, this replacement seems to work just fine. However, when doing a sync "replace" type upgrade, we weren't properly handling this edge case due to path comparison not ignoring trailing slashes. Fix this by pruning any trailing slashes past a certain point of file conflict resolution where we no longer need them, which allows us to safely detect cases such as now tested in the new pactest. Signed-off-by: Dan McGee --- test/pacman/tests/fileconflict008.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/pacman/tests/fileconflict008.py (limited to 'test/pacman') diff --git a/test/pacman/tests/fileconflict008.py b/test/pacman/tests/fileconflict008.py new file mode 100644 index 00000000..24ea8852 --- /dev/null +++ b/test/pacman/tests/fileconflict008.py @@ -0,0 +1,21 @@ +self.description = "Fileconflict file -> dir on package replacement (FS#24904)" + +lp = pmpkg("dummy") +lp.files = ["dir/filepath", + "dir/file"] +self.addpkg2db("local", lp) + +p1 = pmpkg("replace") +p1.provides = ["dummy"] +p1.replaces = ["dummy"] +p1.files = ["dir/filepath/", + "dir/filepath/file", + "dir/file", + "dir/file2"] +self.addpkg2db("sync", p1) + +self.args = "-Su" + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!PKG_EXIST=dummy") +self.addrule("PKG_EXIST=replace") -- cgit v1.2.3-70-g09d2