return false;
// Read the source list
- pkgSourceList List;
- if (List.ReadMainList() == false)
- return _error->Error(_("The list of sources could not be read."));
+ if (Cache.BuildSourceList() == false)
+ return false;
+ pkgSourceList *List = Cache.GetSourceList();
// Create the package manager and prepare to download
SPtr<pkgPackageManager> PM= _system->CreatePM(Cache);
- if (PM->GetArchives(&Fetcher,&List,&Recs) == false ||
+ if (PM->GetArchives(&Fetcher,List,&Recs) == false ||
_error->PendingError() == true)
return false;
// Reload the fetcher object and loop again for media swapping
Fetcher.Shutdown();
- if (PM->GetArchives(&Fetcher,&List,&Recs) == false)
+ if (PM->GetArchives(&Fetcher,List,&Recs) == false)
return false;
_system->Lock();
{
if (CmdL.FileSize() != 1)
return _error->Error(_("The update command takes no arguments"));
-
+
+ CacheFile Cache;
+
// Get the source list
- pkgSourceList List;
- if (List.ReadMainList() == false)
+ if (Cache.BuildSourceList() == false)
return false;
+ pkgSourceList *List = Cache.GetSourceList();
// Create the progress
AcqTextStatus Stat(ScreenWidth,_config->FindI("quiet",0));
// Populate it with the source selection and get all Indexes
// (GetAll=true)
- if (List.GetIndexes(&Fetcher,true) == false)
+ if (List->GetIndexes(&Fetcher,true) == false)
return false;
pkgAcquire::UriIterator I = Fetcher.UriBegin();
}
// do the work
- CacheFile Cache;
if (_config->FindB("APT::Get::Download",true) == true)
- ListUpdate(Stat, List);
+ ListUpdate(Stat, *List);
// Rebuild the cache.
if (Cache.BuildCaches() == false)
return _error->Error(_("Must specify at least one package to fetch source for"));
// Read the source list
- pkgSourceList List;
- if (List.ReadMainList() == false)
- return _error->Error(_("The list of sources could not be read."));
+ if (Cache.BuildSourceList() == false)
+ return false;
+ pkgSourceList *List = Cache.GetSourceList();
// Create the text record parsers
pkgRecords Recs(Cache);
- pkgSrcRecords SrcRecs(List);
+ pkgSrcRecords SrcRecs(*List);
if (_error->PendingError() == true)
return false;
return _error->Error(_("Must specify at least one package to check builddeps for"));
// Read the source list
- pkgSourceList List;
- if (List.ReadMainList() == false)
- return _error->Error(_("The list of sources could not be read."));
+ if (Cache.BuildSourceList() == false)
+ return false;
+ pkgSourceList *List = Cache.GetSourceList();
// Create the text record parsers
pkgRecords Recs(Cache);
- pkgSrcRecords SrcRecs(List);
+ pkgSrcRecords SrcRecs(*List);
if (_error->PendingError() == true)
return false;