]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/algorithms.cc
debian/changelog: and fix the bugnumber (thanks to jackyf
[apt.git] / apt-pkg / algorithms.cc
index 6e2b9755730c11b824dde72ce199b791a5d4972b..bd33d5ef16176e63418860d1e06aa90b5761b400 100644 (file)
@@ -37,7 +37,8 @@ pkgProblemResolver *pkgProblemResolver::This = 0;
    this is not necessary since the pkgCaches are fully shared now. */
 pkgSimulate::pkgSimulate(pkgDepCache *Cache) : pkgPackageManager(Cache),
                            iPolicy(Cache),
-                            Sim(&Cache->GetCache(),&iPolicy)
+                           Sim(&Cache->GetCache(),&iPolicy),
+                           group(Sim)
 {
    Sim.Init(0);
    Flags = new unsigned char[Cache->Head().PackageCount];
@@ -496,7 +497,7 @@ void pkgProblemResolver::MakeScores()
       
       signed short &Score = Scores[I->ID];
       
-      /* This is arbitary, it should be high enough to elevate an
+      /* This is arbitrary, it should be high enough to elevate an
          essantial package above most other packages but low enough
         to allow an obsolete essential packages to be removed by
         a conflicts on a powerfull normal package (ie libc6) */
@@ -985,17 +986,17 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
 
                  if (Start->Type == pkgCache::Dep::DpkgBreaks)
                  {
-                    /* Would it help if we upgraded? */
-                    if (Cache[End] & pkgDepCache::DepGCVer) {
+                    // first, try upgradring the package, if that
+                    // does not help, the breaks goes onto the
+                    // kill list
+                    // FIXME: use DoUpgrade(Pkg) instead?
+                    if (Cache[End] & pkgDepCache::DepGCVer) 
+                    {
                        if (Debug)
                           clog << "  Upgrading " << Pkg.Name() << " due to Breaks field in " << I.Name() << endl;
                        Cache.MarkInstall(Pkg, false, 0, false);
                        continue;
                     }
-                    if (Debug)
-                       clog << "  Will not break " << Pkg.Name() << " as stated in Breaks field in " << I.Name() <<endl;
-                    Cache.MarkKeep(I, false, false);
-                    continue;
                  }
 
                  // Skip adding to the kill list if it is protected
@@ -1066,6 +1067,7 @@ bool pkgProblemResolver::Resolve(bool BrokenFix)
               if ((Cache[J->Dep] & pkgDepCache::DepGNow) == 0)
               {
                  if (J->Dep->Type == pkgCache::Dep::Conflicts || 
+                     J->Dep->Type == pkgCache::Dep::DpkgBreaks ||
                      J->Dep->Type == pkgCache::Dep::Obsoletes)
                  {
                     if (Debug == true)
@@ -1340,7 +1342,11 @@ bool ListUpdate(pkgAcquireStatus &Stat,
 
       (*I)->Finished();
 
-      _error->Warning(_("Failed to fetch %s  %s\n"),(*I)->DescURI().c_str(),
+      ::URI uri((*I)->DescURI());
+      uri.User.clear();
+      uri.Password.clear();
+      string descUri = string(uri);
+      _error->Warning(_("Failed to fetch %s  %s\n"), descUri.c_str(),
              (*I)->ErrorText.c_str());
 
       if ((*I)->Status == pkgAcquire::Item::StatTransientNetworkError) 
@@ -1356,7 +1362,7 @@ bool ListUpdate(pkgAcquireStatus &Stat,
    // Keep "APT::Get::List-Cleanup" name for compatibility, but
    // this is really a global option for the APT library now
    if (!TransientNetworkFailure && !Failed &&
-       (_config->FindB("APT::Get::List-Cleanup",true) == true ||
+       (_config->FindB("APT::Get::List-Cleanup",true) == true &&
        _config->FindB("APT::List-Cleanup",true) == true))
    {
       if (Fetcher.Clean(_config->FindDir("Dir::State::lists")) == false ||
@@ -1371,7 +1377,11 @@ bool ListUpdate(pkgAcquireStatus &Stat,
       return _error->Error(_("Some index files failed to download, they have been ignored, or old ones used instead."));
 
 
-   // Run the scripts if all was fine
+   // Run the success scripts if all was fine
+   if(!TransientNetworkFailure && !Failed)
+      RunScripts("APT::Update::Post-Invoke-Success");
+
+   // Run the other scripts
    RunScripts("APT::Update::Post-Invoke");
    return true;
 }