summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2006-08-11 12:45:33 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2006-08-11 12:45:33 +0200
commit2ae2e04d97028b558bfe954e55a80513e0202889 (patch)
tree99ac6bd156da462a52926c4dc48f50736b18479b /cmdline
parentbe615841e27068522c467899c96c541b74e4c349 (diff)
parent4ef9a929f1cb74f08f764b321cbea62cbfe025a2 (diff)
* merged the apt--install-recommends branch
* ABI break, bumped the version number
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-get.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index d0330b08e..96e974acb 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -629,6 +629,8 @@ void CacheFile::Sort()
and verifies that the system is OK. */
bool CacheFile::CheckDeps(bool AllowBroken)
{
+ bool FixBroken = _config->FindB("APT::Get::Fix-Broken",false);
+
if (_error->PendingError() == true)
return false;
@@ -640,12 +642,24 @@ bool CacheFile::CheckDeps(bool AllowBroken)
if (pkgApplyStatus(*DCache) == false)
return false;
+ if (_config->FindB("APT::Get::Fix-Policy-Broken",false) == true)
+ {
+ FixBroken = true;
+ if ((DCache->PolicyBrokenCount() > 0))
+ {
+ // upgrade all policy-broken packages with ForceImportantDeps=True
+ for (pkgCache::PkgIterator I = Cache->PkgBegin(); !I.end(); I++)
+ if ((*DCache)[I].NowPolicyBroken() == true)
+ DCache->MarkInstall(I,true,0,true);
+ }
+ }
+
// Nothing is broken
if (DCache->BrokenCount() == 0 || AllowBroken == true)
return true;
// Attempt to fix broken things
- if (_config->FindB("APT::Get::Fix-Broken",false) == true)
+ if (FixBroken == true)
{
c1out << _("Correcting dependencies...") << flush;
if (pkgFixBroken(*DCache) == false || DCache->BrokenCount() != 0)
@@ -2618,6 +2632,7 @@ int main(int argc,const char *argv[])
{0,"auto-remove","APT::Get::AutomaticRemove",0},
{0,"allow-unauthenticated","APT::Get::AllowUnauthenticated",0},
{0,"install-recommends","APT::Install-Recommends",CommandLine::Boolean},
+ {0,"fix-policy","APT::Get::Fix-Policy-Broken",0},
{'c',"config-file",0,CommandLine::ConfigFile},
{'o',"option",0,CommandLine::ArbItem},
{0,0,0,0}};