~ubuntu-core-dev/apt/ubuntu

« back to all changes in this revision

Viewing changes to cmdline/apt-get.cc

* merged the apt-breaks-iwj branch
* pulled in the other remaining ubuntu changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1372
1372
      return false;
1373
1373
 
1374
1374
   bool Failed = false;
 
1375
   bool TransientNetworkFailure = false;
1375
1376
   for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++)
1376
1377
   {
1377
1378
      if ((*I)->Status == pkgAcquire::Item::StatDone)
1378
1379
         continue;
1379
1380
 
1380
1381
      (*I)->Finished();
1381
 
      
 
1382
 
1382
1383
      fprintf(stderr,_("Failed to fetch %s  %s\n"),(*I)->DescURI().c_str(),
1383
1384
              (*I)->ErrorText.c_str());
 
1385
 
 
1386
      if ((*I)->Status == pkgAcquire::Item::StatTransientNetworkError) 
 
1387
      {
 
1388
         TransientNetworkFailure = true;
 
1389
         continue;
 
1390
      }
 
1391
 
1384
1392
      Failed = true;
1385
1393
   }
1386
1394
   
1387
1395
   // Clean out any old list files
1388
 
   if (!Failed && _config->FindB("APT::Get::List-Cleanup",true) == true)
 
1396
   if (!TransientNetworkFailure &&
 
1397
       _config->FindB("APT::Get::List-Cleanup",true) == true)
1389
1398
   {
1390
1399
      if (Fetcher.Clean(_config->FindDir("Dir::State::lists")) == false ||
1391
1400
          Fetcher.Clean(_config->FindDir("Dir::State::lists") + "partial/") == false)
1397
1406
   if (Cache.BuildCaches() == false)
1398
1407
      return false;
1399
1408
   
1400
 
   if (Failed == true)
 
1409
   if (TransientNetworkFailure == true)
 
1410
      _error->Warning(_("Some index files failed to download, they have been ignored, or old ones used instead."));
 
1411
   else if (Failed == true)
1401
1412
      return _error->Error(_("Some index files failed to download, they have been ignored, or old ones used instead."));
1402
 
   
 
1413
 
1403
1414
   return true;
1404
1415
}
1405
1416
                                                                        /*}}}*/
1709
1720
         return _error->Error(_("Broken packages"));
1710
1721
      }   
1711
1722
   }
1712
 
   if (!DoAutomaticRemove(Cache)) 
 
1723
   if (_config->FindB("APT::Get::AutomaticRemove")) {
 
1724
      if (!DoAutomaticRemove(Cache)) 
1713
1725
         return false;
 
1726
   }
1714
1727
 
1715
1728
   /* Print out a list of packages that are going to be installed extra
1716
1729
      to what the user asked */
2621
2634
   _config->Set("APT::Get::Fix-Broken",false);
2622
2635
   _config->Set("APT::Get::Force-Yes",false);
2623
2636
   _config->Set("APT::Get::List-Cleanup",true);
 
2637
   _config->Set("APT::Get::AutomaticRemove",false);
2624
2638
}
2625
2639
                                                                        /*}}}*/
2626
2640
// SigWinch - Window size change signal handler                         /*{{{*/