From 4e6361642e632b8631e3d12ee33b1cf5293edb83 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 28 Apr 2008 22:19:56 -0500 Subject: Rework extract_single_file() temp file creation We were a bit juryrigged using one call to mkstemp() before rather than extracting the new files side-by-side and doing our comparisons there. We were also facing some permissions issues. Instead, make our life easier by extracting all temp files to a '.paccheck' extension, doing our md5 comparisons, and then taking the correct actions. Still to be done here- a cleanup of the use of PATH_MAX which should not be necessary if we use dynamic allocation on the heap. Signed-off-by: Dan McGee --- pactest/tests/mode003.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pactest/tests/mode003.py (limited to 'pactest/tests') diff --git a/pactest/tests/mode003.py b/pactest/tests/mode003.py new file mode 100644 index 00000000..1193a5cf --- /dev/null +++ b/pactest/tests/mode003.py @@ -0,0 +1,20 @@ +self.description = "Backup file permissions test (same as orig)" + +lp = pmpkg("filesystem") +lp.files = ["etc/profile|666"] +lp.backup = ["etc/profile*"] +self.addpkg2db("local", lp) + +p = pmpkg("filesystem", "1.0-2") +p.files = ["etc/profile|666**"] +p.backup = ["etc/profile"] +self.addpkg(p) + +self.args = "-U %s" % p.filename() + +self.addrule("PACMAN_RETCODE=0") +self.addrule("!FILE_PACSAVE=etc/profile") +self.addrule("FILE_PACNEW=etc/profile") +self.addrule("FILE_EXIST=etc/profile") +self.addrule("FILE_MODE=etc/profile|666") +self.addrule("FILE_MODE=etc/profile.pacnew|666") -- cgit v1.2.3-70-g09d2