summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPang Yan Han <pangyanhan@gmail.com>2012-08-01 17:34:37 +0200
committerAllan McRae <allan@archlinux.org>2013-01-04 21:49:37 +1000
commitb6320de4be2e39b01c1c03ebac2ffcdfa7ab7098 (patch)
tree50a7993f55866df8354cc857dd298720d0cb6ef6 /test
parent27d9c25ee2fd6a03fb1ec1afdfbe105048875bae (diff)
downloadpacman-b6320de4be2e39b01c1c03ebac2ffcdfa7ab7098.tar.xz
Save backup files with extension .pacsave.n
Teach pacman to save backup files with extension .pacsave.n, where n is a positive integer. The current backup file shall be saved as <name>.pacsave, while existing .pacsave.n files will be renamed to <name>.pacsave.n+1 Example: 1. You have subversion installed in your local repo. /etc/conf.d/svnserve is a file to be backed up. It contains local modifications 2. You remove subversion from your repo. /etc/conf.d/svnserve is backed up as /etc/conf.d/svnserve.pacsave 2. You install subversion again 3. You edit /etc/conf.d/svnserve 4. You remove subversion. The existing /etc/conf.d/svnserve.pacsave is renamed to /etc/conf.d/svnserve.pacsave.1 and /etc/conf.d/svnserve is backed up as /etc/conf.d/svnserve.pacsave Signed-off-by: Pang Yan Han <pangyanhan@gmail.com> Rebased from original email and adjusted for util-common usage. Signed-off-by: Florian Pritz <bluewind@xinu.at> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/tests/remove012.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/pacman/tests/remove012.py b/test/pacman/tests/remove012.py
new file mode 100644
index 00000000..4274487d
--- /dev/null
+++ b/test/pacman/tests/remove012.py
@@ -0,0 +1,20 @@
+self.description = "Remove a package with a modified file marked for backup and has existing pacsaves"
+
+self.filesystem = ["etc/dummy.conf.pacsave",
+ "etc/dummy.conf.pacsave.1",
+ "etc/dummy.conf.pacsave.2"]
+
+p1 = pmpkg("dummy")
+p1.files = ["etc/dummy.conf*"]
+p1.backup = ["etc/dummy.conf"]
+self.addpkg2db("local", p1)
+
+self.args = "-R %s" % p1.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=dummy")
+self.addrule("!FILE_EXIST=etc/dummy.conf")
+self.addrule("FILE_PACSAVE=etc/dummy.conf")
+self.addrule("FILE_EXIST=etc/dummy.conf.pacsave.1")
+self.addrule("FILE_EXIST=etc/dummy.conf.pacsave.2")
+self.addrule("FILE_EXIST=etc/dummy.conf.pacsave.3")