bool const newError = _error->PendingError();
_error->MergeWithStack();
if (newError)
- return false;
+ return _error->ReturnError();
if (Map.Size() <= 0)
return false;
advoid a problem during a crash */
pkgCacheGenerator::~pkgCacheGenerator()
{
- if (_error->PendingError() == true || Map.validData() == false)
+ if (Map.validData() == false)
return;
if (Map.Sync() == false)
return;
while (List.Step() == true)
{
string const PackageName = List.Package();
- if (PackageName.empty() == true) {
- _error->Warning("Encountered a section with no Package: header");
+ if (PackageName.empty() == true)
continue;
- }
Counter++;
if (Counter % 100 == 0 && Progress != 0)
if (NewPackage(Pkg, PackageName, Arch) == false) {
// TRANSLATOR: The first placeholder is a package name,
// the other two should be copied verbatim as they include debug info
- _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ _error->Error(_("Error occurred while processing %s (%s%d)"),
PackageName.c_str(), "NewPackage", 1);
continue;
}
pkgCache::VerIterator Ver(Cache);
Dynamic<pkgCache::VerIterator> DynVer(Ver);
if (List.UsePackage(Pkg, Ver) == false)
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Pkg.Name(), "UsePackage", 1);
// Find the right version to write the description
if (Res == 0 && Ver.end() == false && Ver->Hash == Hash)
{
if (List.UsePackage(Pkg,Ver) == false)
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Pkg.Name(), "UsePackage", 2);
if (NewFileVer(Ver,List) == false)
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Pkg.Name(), "NewFileVer", 1);
// Read only a single record and return
// Add a new version
map_pointer_t const verindex = NewVersion(Ver, Version, Pkg.Index(), Hash, *LastVer);
if (unlikely(verindex == 0))
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Pkg.Name(), "NewVersion", 1);
if (oldMap != Map.Data())
*LastVer = verindex;
if (unlikely(List.NewVersion(Ver) == false))
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Pkg.Name(), "NewVersion", 2);
if (unlikely(List.UsePackage(Pkg,Ver) == false))
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Pkg.Name(), "UsePackage", 3);
if (unlikely(NewFileVer(Ver,List) == false))
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Pkg.Name(), "NewFileVer", 2);
pkgCache::GrpIterator Grp = Pkg.Group();
Dynamic<pkgCache::VerIterator> DynV(V);
for (; V.end() != true; ++V)
if (unlikely(AddImplicitDepends(V, Pkg) == false))
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Pkg.Name(), "AddImplicitDepends", 1);
}
}
if (unlikely(AddImplicitDepends(Grp, Pkg, Ver) == false))
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Pkg.Name(), "AddImplicitDepends", 2);
// Read only a single record and return
map_pointer_t const descindex = NewDescription(Desc, lang, CurMd5, md5idx);
if (unlikely(descindex == 0))
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Ver.ParentPkg().Name(), "NewDescription", 1);
md5idx = Desc->md5sum;
*LastNextDesc = descindex;
if (NewFileDesc(Desc,List) == false)
- return _error->Warning(_("Error occurred while processing %s (%s%d)"),
+ return _error->Error(_("Error occurred while processing %s (%s%d)"),
Ver.ParentPkg().Name(), "NewFileDesc", 1);
return true;
{
if (Debug == true)
std::clog << "Errors are pending or Map is empty() for " << CacheFile << std::endl;
- return false;
+ return _error->ReturnError();
}
std::unique_ptr<bool[]> RlsVisited(new bool[Cache.HeaderP->ReleaseFileCount]);
std::clog << "Validity failed because of pending errors:" << std::endl;
_error->DumpErrors(std::clog, GlobalError::DEBUG, false);
}
- return false;
+ return _error->ReturnError();
}
if (OutMap != 0)
Progress->OverallProgress(CurrentSize, TotalSize, Size, _("Reading package lists"));
CurrentSize += Size;
- if (I->Merge(Gen,Progress) == false)
+ if (I->Merge(Gen,Progress) == false) {
+ _error->ReturnError();
return;
+ }
};
if (List != NULL)
continue;
}
- if ((*i)->Merge(Gen, Progress) == false)
+ if ((*i)->Merge(Gen, Progress) == false) {
+ _error->ReturnError();
continue;
+ }
std::vector <pkgIndexFile *> *Indexes = (*i)->GetIndexFiles();
if (Indexes != NULL)
bool const newError = _error->PendingError();
_error->MergeWithStack();
if (alloc == 0 && newError)
- return false;
+ return _error->ReturnError();
if (CacheF.Read((unsigned char *)Map->Data() + alloc, CacheF.Size()) == false)
return false;
Gen.reset(new pkgCacheGenerator(Map.get(),Progress));
if (Progress != NULL)
Progress->OverallProgress(0,1,1,_("Reading package lists"));
pkgCacheGenerator Gen(Map.get(),Progress);
- if (Gen.Start() == false || _error->PendingError() == true)
+ if (Gen.Start() == false)
return false;
+ if (_error->PendingError() == true)
+ return _error->ReturnError();
BuildCache(Gen,Progress,CurrentSize,TotalSize, NULL,
Files.begin(), Files.end());
+ // We've passed the point of no return
+ _error->ReturnError();
- if (_error->PendingError() == true)
- return false;
*OutMap = Map.release();
return true;