summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2016-12-30 14:08:16 -0800
committerSam Bingner <sam@bingner.com>2019-08-17 12:43:03 -1000
commitb98c468f7e15101f43e08f43670fd04c76bd2128 (patch)
tree752f7b6e6c7f268718d6ea124e9bddf64f77851e /apt-pkg
parentbb696a6ae4385fd77dbee3b700cacc6478b26a93 (diff)
It is just so absolutely critical that this works.
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/indexfile.cc2
-rw-r--r--apt-pkg/pkgcachegen.cc33
2 files changed, 12 insertions, 23 deletions
diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc
index 85d0e87cd..7574283f0 100644
--- a/apt-pkg/indexfile.cc
+++ b/apt-pkg/indexfile.cc
@@ -374,7 +374,7 @@ bool pkgDebianIndexFile::Merge(pkgCacheGenerator &Gen,OpProgress * const Prog)
File->mtime = Pkg.ModificationTime();
if (Gen.MergeList(*Parser) == false)
- return _error->Error("Problem with MergeList %s",PackageFile.c_str());
+ return _error->Warning("Problem with MergeList %s",PackageFile.c_str());
return true;
}
pkgCache::PkgFileIterator pkgDebianIndexFile::FindInCache(pkgCache &Cache) const
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 696155621..8b3f8550d 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -1553,16 +1553,14 @@ static map_filesize_t ComputeSize(pkgSourceList const * const List, FileIterator
}
/*}}}*/
// BuildCache - Merge the list of index files into the cache /*{{{*/
-static bool BuildCache(pkgCacheGenerator &Gen,
+static void BuildCache(pkgCacheGenerator &Gen,
OpProgress * const Progress,
map_filesize_t &CurrentSize,map_filesize_t TotalSize,
pkgSourceList const * const List,
FileIterator const Start, FileIterator const End)
{
- bool mergeFailure = false;
-
auto const indexFileMerge = [&](pkgIndexFile * const I) {
- if (I->HasPackages() == false || mergeFailure)
+ if (I->HasPackages() == false)
return;
if (I->Exists() == false)
@@ -1581,7 +1579,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
CurrentSize += Size;
if (I->Merge(Gen,Progress) == false)
- mergeFailure = true;
+ return;
};
if (List != NULL)
@@ -1601,8 +1599,6 @@ static bool BuildCache(pkgCacheGenerator &Gen,
std::vector <pkgIndexFile *> *Indexes = (*i)->GetIndexFiles();
if (Indexes != NULL)
std::for_each(Indexes->begin(), Indexes->end(), indexFileMerge);
- if (mergeFailure)
- return false;
}
}
@@ -1610,10 +1606,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
{
Gen.SelectReleaseFile("", "");
std::for_each(Start, End, indexFileMerge);
- if (mergeFailure)
- return false;
}
- return true;
}
/*}}}*/
// CacheGenerator::MakeStatusCache - Construct the status cache /*{{{*/
@@ -1788,9 +1781,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
return false;
TotalSize += ComputeSize(&List, Files.begin(),Files.end());
- if (BuildCache(*Gen, Progress, CurrentSize, TotalSize, &List,
- Files.end(),Files.end()) == false)
- return false;
+ BuildCache(*Gen, Progress, CurrentSize, TotalSize, &List,
+ Files.end(),Files.end());
if (Writeable == true && SrcCacheFileName.empty() == false)
if (writeBackMMapToFile(Gen.get(), Map.get(), SrcCacheFileName) == false)
@@ -1801,9 +1793,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
{
if (Debug == true)
std::clog << "Building status cache in pkgcache.bin now" << std::endl;
- if (BuildCache(*Gen, Progress, CurrentSize, TotalSize, NULL,
- Files.begin(), Files.end()) == false)
- return false;
+ BuildCache(*Gen, Progress, CurrentSize, TotalSize, NULL,
+ Files.begin(), Files.end());
if (Writeable == true && CacheFileName.empty() == false)
if (writeBackMMapToFile(Gen.get(), Map.get(), CacheFileName) == false)
@@ -1824,9 +1815,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
}
Files = List.GetVolatileFiles();
- if (BuildCache(*Gen, Progress, CurrentSize, TotalSize, NULL,
- Files.begin(), Files.end()) == false)
- return false;
+ BuildCache(*Gen, Progress, CurrentSize, TotalSize, NULL,
+ Files.begin(), Files.end());
}
if (OutMap != nullptr)
@@ -1865,9 +1855,8 @@ bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **O
pkgCacheGenerator Gen(Map.get(),Progress);
if (Gen.Start() == false || _error->PendingError() == true)
return false;
- if (BuildCache(Gen,Progress,CurrentSize,TotalSize, NULL,
- Files.begin(), Files.end()) == false)
- return false;
+ BuildCache(Gen,Progress,CurrentSize,TotalSize, NULL,
+ Files.begin(), Files.end());
if (_error->PendingError() == true)
return false;