X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/8efa2a3ba4ae833415223a888e4561e57e4bf132..0118833a3b3e65ad7296863aa7d49574eb615f83:/apt-pkg/init.cc diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 63e808118..c8b35de17 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: init.cc,v 1.3 1998/07/16 06:08:36 jgg Exp $ +// $Id: init.cc,v 1.7 1998/10/09 19:57:21 jgg Exp $ /* ###################################################################### Init - Initialize the package library @@ -9,6 +9,9 @@ /*}}}*/ // Include files /*{{{*/ #include + +#include +#include /*}}}*/ // pkgInitialize - Initialize the configuration class /*{{{*/ @@ -24,20 +27,30 @@ bool pkgInitialize(Configuration &Cnf) // State Cnf.Set("Dir::State","/var/state/apt/"); Cnf.Set("Dir::State::lists","lists/"); + + /* These really should be jammed into a generic 'Local Database' engine + which is yet to be determined. The functions in pkgcachegen should + be the only users of these */ Cnf.Set("Dir::State::xstatus","xstatus"); - Cnf.Set("Dir::State::userstatus","status.user"); + Cnf.Set("Dir::State::userstatus","status.user"); + Cnf.Set("Dir::State::status","/var/lib/dpkg/status"); // Cache - Cnf.Set("Dir::Cache","/etc/apt/"); + Cnf.Set("Dir::Cache","/var/cache/apt/"); Cnf.Set("Dir::Cache::archives","archives/"); - Cnf.Set("Dir::Cache::srcpkgcache","srcpkgcache"); - Cnf.Set("Dir::Cache::pkhcache","pkgcache"); + Cnf.Set("Dir::Cache::srcpkgcache","srcpkgcache.bin"); + Cnf.Set("Dir::Cache::pkgcache","pkgcache.bin"); // Configuration Cnf.Set("Dir::Etc","/etc/apt/"); Cnf.Set("Dir::Etc::sourcelist","sources.list"); Cnf.Set("Dir::Etc::main","apt.conf"); - - return true; + + // Read the main config file + string FName = Cnf.FindDir("Dir::Etc::main"); + struct stat Buf; + if (stat(FName.c_str(),&Buf) != 0) + return true; + return ReadConfigFile(Cnf,FName); } /*}}}*/