X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/bfd22fc0ac2632c6196f5149dc3b3671d9ff15e0..7974b907ac33f2a5d7c7ad75c0cb13166f642ec1:/apt-pkg/init.cc diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index f79668c54..29926b97a 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.10 1998/11/05 07:21:42 jgg Exp $ +// $Id: init.cc,v 1.14 1998/11/25 23:54:06 jgg Exp $ /* ###################################################################### Init - Initialize the package library @@ -9,10 +9,8 @@ /*}}}*/ // Include files /*{{{*/ #include +#include #include - -#include -#include /*}}}*/ // pkgInitialize - Initialize the configuration class /*{{{*/ @@ -35,6 +33,7 @@ bool pkgInitialize(Configuration &Cnf) Cnf.Set("Dir::State::xstatus","xstatus"); Cnf.Set("Dir::State::userstatus","status.user"); Cnf.Set("Dir::State::status","/var/lib/dpkg/status"); + Cnf.Set("Dir::State::cdroms","cdroms.list"); // Cache Cnf.Set("Dir::Cache","/var/cache/apt/"); @@ -47,19 +46,20 @@ bool pkgInitialize(Configuration &Cnf) Cnf.Set("Dir::Etc::sourcelist","sources.list"); Cnf.Set("Dir::Etc::main","apt.conf"); Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods"); + Cnf.Set("Dir::Bin::dpkg","/usr/bin/dpkg"); // Read the main config file string FName = Cnf.FindFile("Dir::Etc::main"); - struct stat Buf; - if (stat(FName.c_str(),&Buf) != 0) - return true; + bool Res = true; + if (FileExists(FName) == true) + Res &= ReadConfigFile(Cnf,FName); // Read an alternate config file const char *Cfg = getenv("APT_CONFIG"); + if (Cfg != 0 && FileExists(Cfg) == true) + Res &= ReadConfigFile(Cnf,Cfg); - // Read both config files, either existing will be OK - if ((ReadConfigFile(Cnf,FName) != true) | - (ReadConfigFile(Cnf,Cfg) != true)) + if (Res == false) return false; if (Cnf.FindB("Debug::pkgInitialize",false) == true)