summaryrefslogtreecommitdiff
path: root/test/pacman/tests/remove-directory-replaced-with-symlink.py
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2017-04-09 19:49:17 -0400
committerAndrew Gregory <andrew.gregory.8@gmail.com>2017-04-16 19:41:35 -0400
commit16b91f798faf6413f9b043543c5c0c3467b6fdbf (patch)
tree929d4406c6fe65d234bb5239dd6b027cedd80654 /test/pacman/tests/remove-directory-replaced-with-symlink.py
parentf9de3b22ad9e532af14c8d5b0b90a3f0f747e331 (diff)
unlink_file: strip trailing slashes
If the user replaces a directory with a symlink, libalpm would get confused because the trailing slash causes system calls to resolve the symlink. This leads to errors and a misleading message during upgrades. Even though libalpm does not support this, it should not be giving misleading errors. Also adds an overflow check. Fixes FS#51377 Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Diffstat (limited to 'test/pacman/tests/remove-directory-replaced-with-symlink.py')
-rw-r--r--test/pacman/tests/remove-directory-replaced-with-symlink.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/pacman/tests/remove-directory-replaced-with-symlink.py b/test/pacman/tests/remove-directory-replaced-with-symlink.py
new file mode 100644
index 00000000..37be7579
--- /dev/null
+++ b/test/pacman/tests/remove-directory-replaced-with-symlink.py
@@ -0,0 +1,16 @@
+self.description = "remove a package with a directory that has been replaced with a symlink"
+
+self.filesystem = [ "var/", "srv -> var/" ]
+
+lpkg = pmpkg("pkg1")
+lpkg.files = ["srv/"]
+self.addpkg2db("local", lpkg)
+
+self.args = "-R %s" % (lpkg.name)
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("DIR_EXIST=var/")
+self.addrule("!LINK_EXIST=srv")
+self.addrule("!FILE_EXIST=srv")
+self.addrule("!DIR_EXIST=srv")
+self.addrule("!PACMAN_OUTPUT=cannot remove")