- string FName = Cnf.FindDir("Dir::Etc::main");
- struct stat Buf;
- if (stat(FName.c_str(),&Buf) != 0)
- return true;
- return ReadConfigFile(Cnf,FName);
+ string FName = Cnf.FindFile("Dir::Etc::main");
+ 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);
+
+ if (Res == false)
+ return false;
+
+ if (Cnf.FindB("Debug::pkgInitialize",false) == true)
+ Cnf.Dump();
+
+ return true;