From 7bd2ff685188d0d9b6ab6c6f43f6d28811936881 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 31 May 2007 02:51:28 -0400 Subject: Move DB and cache dirs away from there dependence on ROOTDIR This change allows us to use all autoconf specified paths, most notably $(localstatedir). It is quite a change and touches a lot of files, as all references to the DB and cache were done with the ROOTDIR as a prefix. * add --lock command-line option to pacman to specify the location of the lockfile (this can now be specified at configure time by setting the $localstatedir path). * Rip quite a few settings out of configure.ac as they are now picked by setting the paths during configure or make. * Fix bug with /tmp fallback for sync downloads not working correctly (related to root location, now the system tmp dir is used). * Simplified the parameters to some libalpm functions, and added get/set for the new lockfile option. * Renamed several of the DEFS to names without the PM_ prefix. Signed-off-by: Dan McGee --- pactest/pmtest.py | 9 +++++++-- pactest/util.py | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'pactest') diff --git a/pactest/pmtest.py b/pactest/pmtest.py index 06b65bbb..dd524211 100755 --- a/pactest/pmtest.py +++ b/pactest/pmtest.py @@ -192,8 +192,13 @@ class pmtest: cmd.append("libtool gdb --args") if pacman["valgrind"]: cmd.append("valgrind --tool=memcheck --leak-check=full --show-reachable=yes") - cmd.append("%s --config=%s --root=%s" \ - % (pacman["bin"], os.path.join(self.root, PACCONF), self.root)) + cmd.append("%s --config=%s --root=%s --dbpath=%s --cachedir=%s --lock=%s" \ + % (pacman["bin"], + os.path.join(self.root, PACCONF), + self.root, + os.path.join(self.root, PM_DBPATH), + os.path.join(self.root, PM_CACHEDIR), + os.path.join(self.root, PM_LOCK) )) if not pacman["manual-confirm"]: cmd.append("--noconfirm") if pacman["debug"]: diff --git a/pactest/util.py b/pactest/util.py index 574a59be..98c22a5c 100755 --- a/pactest/util.py +++ b/pactest/util.py @@ -28,7 +28,7 @@ import stat PM_ROOT = "/" PM_DBPATH = "var/lib/pacman" PM_CACHEDIR = "var/cache/pacman/pkg" -PM_LOCK = "/tmp/pacman.lck" +PM_LOCK = "var/run/pacman.lck" PM_EXT_PKG = ".pkg.tar.gz" PM_EXT_DB = ".db.tar.gz" PM_PACNEW = ".pacnew" -- cgit v1.2.3-70-g09d2