summaryrefslogtreecommitdiff
path: root/apt-pkg/init.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/init.cc')
-rw-r--r--apt-pkg/init.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
index af4e6faa0..207f0d902 100644
--- a/apt-pkg/init.cc
+++ b/apt-pkg/init.cc
@@ -212,14 +212,13 @@ bool pkgInitConfig(Configuration &Cnf)
Cnf.CndSet("Acquire::Changelogs::URI::Origin::Ultimedia", "http://packages.ultimediaos.com/changelogs/pool/@CHANGEPATH@/changelog.txt");
Cnf.CndSet("Acquire::Changelogs::AlwaysOnline::Origin::Ubuntu", true);
- bool Res = true;
-
// Read an alternate config file
+ _error->PushToStack();
const char *Cfg = getenv("APT_CONFIG");
if (Cfg != 0 && strlen(Cfg) != 0)
{
if (RealFileExists(Cfg) == true)
- Res &= ReadConfigFile(Cnf,Cfg);
+ ReadConfigFile(Cnf, Cfg);
else
_error->WarningE("RealFileExists",_("Unable to read %s"),Cfg);
}
@@ -227,30 +226,29 @@ bool pkgInitConfig(Configuration &Cnf)
// Read the configuration parts dir
std::string const Parts = Cnf.FindDir("Dir::Etc::parts", "/dev/null");
if (DirectoryExists(Parts) == true)
- Res &= ReadConfigDir(Cnf,Parts);
+ ReadConfigDir(Cnf, Parts);
else if (APT::String::Endswith(Parts, "/dev/null") == false)
_error->WarningE("DirectoryExists",_("Unable to read %s"),Parts.c_str());
// Read the main config file
std::string const FName = Cnf.FindFile("Dir::Etc::main", "/dev/null");
if (RealFileExists(FName) == true)
- Res &= ReadConfigFile(Cnf,FName);
-
- if (Res == false)
- return false;
+ ReadConfigFile(Cnf, FName);
if (Cnf.FindB("Debug::pkgInitConfig",false) == true)
Cnf.Dump();
-
+
#ifdef APT_DOMAIN
if (Cnf.Exists("Dir::Locale"))
- {
+ {
bindtextdomain(APT_DOMAIN,Cnf.FindDir("Dir::Locale").c_str());
bindtextdomain(textdomain(0),Cnf.FindDir("Dir::Locale").c_str());
}
#endif
- return true;
+ auto const good = _error->PendingError() == false;
+ _error->MergeWithStack();
+ return good;
}
/*}}}*/
// pkgInitSystem - Initialize the _system calss /*{{{*/