From b6320de4be2e39b01c1c03ebac2ffcdfa7ab7098 Mon Sep 17 00:00:00 2001 From: Pang Yan Han Date: Wed, 1 Aug 2012 17:34:37 +0200 Subject: 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 .pacsave, while existing .pacsave.n files will be renamed to .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 Rebased from original email and adjusted for util-common usage. Signed-off-by: Florian Pritz Signed-off-by: Allan McRae --- test/pacman/tests/remove012.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/pacman/tests/remove012.py (limited to 'test') 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") -- cgit v1.2.3-70-g09d2