summaryrefslogtreecommitdiff
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2016-12-30 14:08:16 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2016-12-30 14:08:16 -0800
commitd52f68c8d7e385613076d9ef56af179532139ac8 (patch)
treedf3c1f50dfc22cf5f8063fff63b914d3ce082dc1 /apt-pkg/pkgcachegen.cc
parentcc51afda7080d6f3cc1cffe6f956d5376c4cb40e (diff)
It is just so absolutely critical that this works.
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-rw-r--r--apt-pkg/pkgcachegen.cc33
1 files changed, 11 insertions, 22 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 1bdd43bf8..51bb9ec7b 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -1550,16 +1550,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)
@@ -1578,7 +1576,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
CurrentSize += Size;
if (I->Merge(Gen,Progress) == false)
- mergeFailure = true;
+ return;
};
if (List != NULL)
@@ -1598,8 +1596,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;
}
}
@@ -1607,10 +1603,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 /*{{{*/
@@ -1784,9 +1777,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 && SrcCacheFile.empty() == false)
if (writeBackMMapToFile(Gen.get(), Map.get(), SrcCacheFile) == false)
@@ -1797,9 +1789,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 && CacheFile.empty() == false)
if (writeBackMMapToFile(Gen.get(), Map.get(), CacheFile) == false)
@@ -1820,9 +1811,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)
@@ -1861,9 +1851,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;