From 56d53b54e795479194eb653741c5a816698db43f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 2 Apr 2011 15:51:37 +0200 Subject: disable the error discarding as it destroyes the error reporting about failures with external solvers for now as long as i can't see a reason for it --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6ffecd777..a1264f54a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1887,7 +1887,7 @@ bool DoInstall(CommandLine &CmdL) // Call the scored problem resolver Fix->InstallProtect(); if (Fix->Resolve(true) == false) - _error->Discard(); + ; //FIXME: is there a valid reason for? _error->Discard(); delete Fix; } -- cgit v1.2.3-70-g09d2 From df783e0aa69f70b7be2b7fb44cc593efd86f7730 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 3 May 2011 14:17:29 +0200 Subject: add a --solver option to apt-get --- cmdline/apt-get.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index a1264f54a..2312f5a10 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -3253,6 +3253,7 @@ int main(int argc,const char *argv[]) /*{{{*/ {0,"install-recommends","APT::Install-Recommends",CommandLine::Boolean}, {0,"install-suggests","APT::Install-Suggests",CommandLine::Boolean}, {0,"fix-policy","APT::Get::Fix-Policy-Broken",0}, + {0,"solver","APT::Solver::Name",CommandLine::HasArg}, {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, {0,0,0,0}}; -- cgit v1.2.3-70-g09d2 From 98278a81bf554246b70b97852c9b8b92eac390ea Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 17 May 2011 17:42:01 +0200 Subject: rename option APT::Solver::Name to simply APT::Solver --- apt-pkg/algorithms.cc | 8 ++++---- apt-pkg/depcache.cc | 4 ++-- apt-pkg/edsp.cc | 2 +- cmdline/apt-get.cc | 2 +- cmdline/apt-internal-solver.cc | 2 +- doc/external-dependency-solver-protocol.txt | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'cmdline/apt-get.cc') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 6f1f82d50..47bdd4aba 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -330,7 +330,7 @@ bool pkgFixBroken(pkgDepCache &Cache) */ bool pkgDistUpgrade(pkgDepCache &Cache) { - std::string const solver = _config->Find("APT::Solver::Name", "internal"); + std::string const solver = _config->Find("APT::Solver", "internal"); if (solver != "internal") { OpTextProgress Prog(*_config); return EDSP::ResolveExternal(solver.c_str(), Cache, false, true, false, &Prog); @@ -388,7 +388,7 @@ bool pkgDistUpgrade(pkgDepCache &Cache) to install packages not marked for install */ bool pkgAllUpgrade(pkgDepCache &Cache) { - std::string const solver = _config->Find("APT::Solver::Name", "internal"); + std::string const solver = _config->Find("APT::Solver", "internal"); if (solver != "internal") { OpTextProgress Prog(*_config); return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, &Prog); @@ -745,7 +745,7 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg) /* */ bool pkgProblemResolver::Resolve(bool BrokenFix) { - std::string const solver = _config->Find("APT::Solver::Name", "internal"); + std::string const solver = _config->Find("APT::Solver", "internal"); if (solver != "internal") { OpTextProgress Prog(*_config); return EDSP::ResolveExternal(solver.c_str(), Cache, false, false, false, &Prog); @@ -1211,7 +1211,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) system was non-broken previously. */ bool pkgProblemResolver::ResolveByKeep() { - std::string const solver = _config->Find("APT::Solver::Name", "internal"); + std::string const solver = _config->Find("APT::Solver", "internal"); if (solver != "internal") { OpTextProgress Prog(*_config); return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, &Prog); diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 5cb68804d..947435706 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1046,7 +1046,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, Update(Pkg); AddSizes(Pkg); - if (AutoInst == false || _config->Find("APT::Solver::Name", "internal") != "internal") + if (AutoInst == false || _config->Find("APT::Solver", "internal") != "internal") return; if (DebugMarker == true) @@ -1605,7 +1605,7 @@ bool pkgDepCache::MarkFollowsSuggests() // pkgDepCache::MarkRequired - the main mark algorithm /*{{{*/ bool pkgDepCache::MarkRequired(InRootSetFunc &userFunc) { - if (_config->Find("APT::Solver::Name", "internal") != "internal") + if (_config->Find("APT::Solver", "internal") != "internal") return true; bool follow_recommends; diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 218ce9f24..02ef7d04b 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -231,7 +231,7 @@ bool EDSP::WriteRequest(pkgDepCache &Cache, FILE* output, bool const Upgrade, if (_config->FindB("APT::Solver::Strict-Pinning", true) == false) fprintf(output, "Strict-Pinning: no\n"); string solverpref("APT::Solver::"); - solverpref.append(_config->Find("APT::Solver::Name", "internal")).append("::Preferences"); + solverpref.append(_config->Find("APT::Solver", "internal")).append("::Preferences"); if (_config->Exists(solverpref) == true) fprintf(output, "Preferences: %s\n", _config->Find(solverpref,"").c_str()); fprintf(output, "\n"); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index fdb1033a1..d48ca18f9 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -3270,7 +3270,7 @@ int main(int argc,const char *argv[]) /*{{{*/ {0,"install-recommends","APT::Install-Recommends",CommandLine::Boolean}, {0,"install-suggests","APT::Install-Suggests",CommandLine::Boolean}, {0,"fix-policy","APT::Get::Fix-Policy-Broken",0}, - {0,"solver","APT::Solver::Name",CommandLine::HasArg}, + {0,"solver","APT::Solver",CommandLine::HasArg}, {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, {0,0,0,0}}; diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index ad00a0e23..ef6c688fe 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -97,7 +97,7 @@ int main(int argc,const char *argv[]) /*{{{*/ if (_config->FindI("quiet", 0) < 1) _config->Set("Debug::EDSP::WriteSolution", true); - _config->Set("APT::Solver::Name", "internal"); + _config->Set("APT::Solver", "internal"); _config->Set("edsp::scenario", "stdin"); int input = STDIN_FILENO; FILE* output = stdout; diff --git a/doc/external-dependency-solver-protocol.txt b/doc/external-dependency-solver-protocol.txt index ae01fbc35..7a124d8f9 100644 --- a/doc/external-dependency-solver-protocol.txt +++ b/doc/external-dependency-solver-protocol.txt @@ -47,7 +47,7 @@ Several APT options can be used to affect dependency solving in APT. An overview of them is given below. Please refer to proper APT configuration documentation for more, and more up to date, information. -- **APT::Solver::Name**: the name of the solver to be used for +- **APT::Solver**: the name of the solver to be used for dependency solving. Defaults to `internal` - **APT::Solver::Strict-Pinning**: whether pinning must be strictly -- cgit v1.2.3-70-g09d2 From d953d210bb54accb416f2144104b79dcd29198ba Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 17 May 2011 20:20:46 +0200 Subject: * cmdline/apt-get.cc: - do not discard the error messages from the resolver and instead only show the general 'Broken packages' message if nothing else --- cmdline/apt-get.cc | 10 ++++++---- debian/changelog | 5 ++++- test/integration/test-handling-broken-orgroups | 4 ++-- test/integration/test-release-candidate-switching | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index d48ca18f9..65eaef0d8 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1886,8 +1886,7 @@ bool DoInstall(CommandLine &CmdL) { // Call the scored problem resolver Fix->InstallProtect(); - if (Fix->Resolve(true) == false) - ; //FIXME: is there a valid reason for? _error->Discard(); + Fix->Resolve(true); delete Fix; } @@ -1913,8 +1912,11 @@ bool DoInstall(CommandLine &CmdL) c1out << _("The following information may help to resolve the situation:") << endl; c1out << endl; ShowBroken(c1out,Cache,false); - return _error->Error(_("Broken packages")); - } + if (_error->PendingError() == true) + return false; + else + return _error->Error(_("Broken packages")); + } } if (!DoAutomaticRemove(Cache)) return false; diff --git a/debian/changelog b/debian/changelog index 9fc6dc193..71f64dc23 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,12 +16,15 @@ apt (0.8.15) UNRELEASED; urgency=low - let the Mark methods return if their marking was successful - if a Breaks can't be upgraded, remove it. If it or a Conflict can't be removed the installation of the breaker fails. + * cmdline/apt-get.cc: + - do not discard the error messages from the resolver and instead + only show the general 'Broken packages' message if nothing else [ Stefano Zacchiroli ] * doc/external-dependency-solver-protocol.txt: - describe EDSP and the configuration interface around it - -- David Kalnischkies Tue, 17 May 2011 17:59:24 +0200 + -- David Kalnischkies Tue, 17 May 2011 18:43:21 +0200 apt (0.8.14.2) UNRELEASED; urgency=low diff --git a/test/integration/test-handling-broken-orgroups b/test/integration/test-handling-broken-orgroups index d88ad0000..20b314074 100755 --- a/test/integration/test-handling-broken-orgroups +++ b/test/integration/test-handling-broken-orgroups @@ -58,7 +58,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: coolstuff-broken : Depends: cool2 but it is not installable or stuff2 but it is not installable -E: Broken packages' aptget install coolstuff-broken -s +E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-broken -s testequal 'Reading package lists... Building dependency tree... @@ -105,4 +105,4 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: coolstuff-provided-broken : Depends: cool2 but it is not installable or stuff-abi-2 -E: Broken packages' aptget install coolstuff-provided-broken -s +E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-provided-broken -s diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching index b6dbe99db..0970cb935 100755 --- a/test/integration/test-release-candidate-switching +++ b/test/integration/test-release-candidate-switching @@ -416,4 +416,4 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: uninstallablepkg : Depends: libmtp8 (>= 10:0.20.1) but it is not going to be installed Depends: amarok-utils (= 2.3.2-2+exp) but 2.3.1-1+sid is to be installed -E: Broken packages" aptget install uninstallablepkg/experimental --trivial-only -V -q=0 +E: Unable to correct problems, you have held broken packages." aptget install uninstallablepkg/experimental --trivial-only -V -q=0 -- cgit v1.2.3-70-g09d2