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;
// Number of bytes
if (DebBytes != FetchBytes)
+ //TRANSLATOR: The required space between number and unit is already included
+ // in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB
ioprintf(c1out,_("Need to get %sB/%sB of archives.\n"),
SizeToStr(FetchBytes).c_str(),SizeToStr(DebBytes).c_str());
else if (DebBytes != 0)
+ //TRANSLATOR: The required space between number and unit is already included
+ // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
ioprintf(c1out,_("Need to get %sB of archives.\n"),
SizeToStr(DebBytes).c_str());
// Size delta
if (Cache->UsrSize() >= 0)
+ //TRANSLATOR: The required space between number and unit is already included
+ // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
ioprintf(c1out,_("After this operation, %sB of additional disk space will be used.\n"),
SizeToStr(Cache->UsrSize()).c_str());
else
+ //TRANSLATOR: The required space between number and unit is already included
+ // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
ioprintf(c1out,_("After this operation, %sB disk space will be freed.\n"),
SizeToStr(-1*Cache->UsrSize()).c_str());
// 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)
if (doAutoRemove == false && (autoremovelist.empty() == false || autoRemoveCount != 0))
{
if (smallList == false)
- ShowList(c1out, P_("The following package is automatically installed and is no longer required:",
+ ShowList(c1out, P_("The following package was automatically installed and is no longer required:",
"The following packages were automatically installed and are no longer required:",
autoRemoveCount), autoremovelist, autoremoveversions);
else
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;
// Number of bytes
if (DebBytes != FetchBytes)
+ //TRANSLATOR: The required space between number and unit is already included
+ // in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB
ioprintf(c1out,_("Need to get %sB/%sB of source archives.\n"),
SizeToStr(FetchBytes).c_str(),SizeToStr(DebBytes).c_str());
else
+ //TRANSLATOR: The required space between number and unit is already included
+ // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
ioprintf(c1out,_("Need to get %sB of source archives.\n"),
SizeToStr(DebBytes).c_str());
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;
return true;
}
/*}}}*/
-// GetInitialize - Initialize things for apt-get /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-void GetInitialize()
-{
- _config->Set("quiet",0);
- _config->Set("help",false);
- _config->Set("APT::Get::Download-Only",false);
- _config->Set("APT::Get::Simulate",false);
- _config->Set("APT::Get::Assume-Yes",false);
- _config->Set("APT::Get::Fix-Broken",false);
- _config->Set("APT::Get::Force-Yes",false);
- _config->Set("APT::Get::List-Cleanup",true);
- _config->Set("APT::Get::AutomaticRemove",false);
-}
- /*}}}*/
// SigWinch - Window size change signal handler /*{{{*/
// ---------------------------------------------------------------------
/* */