From 8757a0fdeee00ea6a7cc717188a0e129ad8a553c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 23 Aug 2016 19:41:58 +0200 Subject: Make directory paths configurable This allows other vendors to use different paths, or to build your own APT in /opt for testing. Note that this uses + 1 in some places, as the paths we receive are absolute, but we need to strip of the initial /. --- apt-pkg/init.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'apt-pkg/init.cc') diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index fa679e6c6..282c0daf0 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -47,19 +47,19 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.CndSet("Dir","/"); // State - Cnf.CndSet("Dir::State","var/lib/apt/"); + Cnf.CndSet("Dir::State", STATE_DIR + 1); Cnf.CndSet("Dir::State::lists","lists/"); Cnf.CndSet("Dir::State::cdroms","cdroms.list"); Cnf.CndSet("Dir::State::mirrors","mirrors/"); // Cache - Cnf.CndSet("Dir::Cache","var/cache/apt/"); + Cnf.CndSet("Dir::Cache", CACHE_DIR + 1); Cnf.CndSet("Dir::Cache::archives","archives/"); Cnf.CndSet("Dir::Cache::srcpkgcache","srcpkgcache.bin"); Cnf.CndSet("Dir::Cache::pkgcache","pkgcache.bin"); // Configuration - Cnf.CndSet("Dir::Etc","etc/apt/"); + Cnf.CndSet("Dir::Etc", CONF_DIR + 1); Cnf.CndSet("Dir::Etc::sourcelist","sources.list"); Cnf.CndSet("Dir::Etc::sourceparts","sources.list.d"); Cnf.CndSet("Dir::Etc::main","apt.conf"); @@ -69,12 +69,12 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.CndSet("Dir::Etc::preferencesparts","preferences.d"); Cnf.CndSet("Dir::Etc::trusted", "trusted.gpg"); Cnf.CndSet("Dir::Etc::trustedparts","trusted.gpg.d"); - Cnf.CndSet("Dir::Bin::methods","/usr/lib/apt/methods"); - Cnf.CndSet("Dir::Bin::solvers::","/usr/lib/apt/solvers"); + Cnf.CndSet("Dir::Bin::methods", LIBEXEC_DIR "/methods"); + Cnf.CndSet("Dir::Bin::solvers::",LIBEXEC_DIR "/apt/solvers"); Cnf.CndSet("Dir::Media::MountPath","/media/apt"); // State - Cnf.CndSet("Dir::Log","var/log/apt"); + Cnf.CndSet("Dir::Log", LOG_DIR + 1); Cnf.CndSet("Dir::Log::Terminal","term.log"); Cnf.CndSet("Dir::Log::History","history.log"); Cnf.CndSet("Dir::Log::Planner","eipp.log.xz"); -- cgit v1.2.3