|
@@ -1550,16 +1550,14 @@ static map_filesize_t ComputeSize(pkgSourceList const * const List, FileIterator
|
|
|
}
|
|
}
|
|
|
/*}}}*/
|
|
/*}}}*/
|
|
|
// BuildCache - Merge the list of index files into the cache /*{{{*/
|
|
// BuildCache - Merge the list of index files into the cache /*{{{*/
|
|
|
-static bool BuildCache(pkgCacheGenerator &Gen,
|
|
|
|
|
|
|
+static void BuildCache(pkgCacheGenerator &Gen,
|
|
|
OpProgress * const Progress,
|
|
OpProgress * const Progress,
|
|
|
map_filesize_t &CurrentSize,map_filesize_t TotalSize,
|
|
map_filesize_t &CurrentSize,map_filesize_t TotalSize,
|
|
|
pkgSourceList const * const List,
|
|
pkgSourceList const * const List,
|
|
|
FileIterator const Start, FileIterator const End)
|
|
FileIterator const Start, FileIterator const End)
|
|
|
{
|
|
{
|
|
|
- bool mergeFailure = false;
|
|
|
|
|
-
|
|
|
|
|
auto const indexFileMerge = [&](pkgIndexFile * const I) {
|
|
auto const indexFileMerge = [&](pkgIndexFile * const I) {
|
|
|
- if (I->HasPackages() == false || mergeFailure)
|
|
|
|
|
|
|
+ if (I->HasPackages() == false)
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
if (I->Exists() == false)
|
|
if (I->Exists() == false)
|
|
@@ -1578,7 +1576,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
|
|
|
CurrentSize += Size;
|
|
CurrentSize += Size;
|
|
|
|
|
|
|
|
if (I->Merge(Gen,Progress) == false)
|
|
if (I->Merge(Gen,Progress) == false)
|
|
|
- mergeFailure = true;
|
|
|
|
|
|
|
+ return;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
if (List != NULL)
|
|
if (List != NULL)
|
|
@@ -1598,8 +1596,6 @@ static bool BuildCache(pkgCacheGenerator &Gen,
|
|
|
std::vector <pkgIndexFile *> *Indexes = (*i)->GetIndexFiles();
|
|
std::vector <pkgIndexFile *> *Indexes = (*i)->GetIndexFiles();
|
|
|
if (Indexes != NULL)
|
|
if (Indexes != NULL)
|
|
|
std::for_each(Indexes->begin(), Indexes->end(), indexFileMerge);
|
|
std::for_each(Indexes->begin(), Indexes->end(), indexFileMerge);
|
|
|
- if (mergeFailure)
|
|
|
|
|
- return false;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1607,10 +1603,7 @@ static bool BuildCache(pkgCacheGenerator &Gen,
|
|
|
{
|
|
{
|
|
|
Gen.SelectReleaseFile("", "");
|
|
Gen.SelectReleaseFile("", "");
|
|
|
std::for_each(Start, End, indexFileMerge);
|
|
std::for_each(Start, End, indexFileMerge);
|
|
|
- if (mergeFailure)
|
|
|
|
|
- return false;
|
|
|
|
|
}
|
|
}
|
|
|
- return true;
|
|
|
|
|
}
|
|
}
|
|
|
/*}}}*/
|
|
/*}}}*/
|
|
|
// CacheGenerator::MakeStatusCache - Construct the status cache /*{{{*/
|
|
// CacheGenerator::MakeStatusCache - Construct the status cache /*{{{*/
|
|
@@ -1784,9 +1777,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
|
|
|
return false;
|
|
return false;
|
|
|
|
|
|
|
|
TotalSize += ComputeSize(&List, Files.begin(),Files.end());
|
|
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 (Writeable == true && SrcCacheFile.empty() == false)
|
|
|
if (writeBackMMapToFile(Gen.get(), Map.get(), SrcCacheFile) == false)
|
|
if (writeBackMMapToFile(Gen.get(), Map.get(), SrcCacheFile) == false)
|
|
@@ -1797,9 +1789,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
|
|
|
{
|
|
{
|
|
|
if (Debug == true)
|
|
if (Debug == true)
|
|
|
std::clog << "Building status cache in pkgcache.bin now" << std::endl;
|
|
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 (Writeable == true && CacheFile.empty() == false)
|
|
|
if (writeBackMMapToFile(Gen.get(), Map.get(), CacheFile) == false)
|
|
if (writeBackMMapToFile(Gen.get(), Map.get(), CacheFile) == false)
|
|
@@ -1820,9 +1811,8 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Files = List.GetVolatileFiles();
|
|
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)
|
|
if (OutMap != nullptr)
|
|
@@ -1861,9 +1851,8 @@ bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **O
|
|
|
pkgCacheGenerator Gen(Map.get(),Progress);
|
|
pkgCacheGenerator Gen(Map.get(),Progress);
|
|
|
if (Gen.Start() == false || _error->PendingError() == true)
|
|
if (Gen.Start() == false || _error->PendingError() == true)
|
|
|
return false;
|
|
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)
|
|
if (_error->PendingError() == true)
|
|
|
return false;
|
|
return false;
|