Skip to content

Commit

Permalink
don't ovwerrite 'considered' map when using minversions (fixes: #367)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverkurth committed Nov 16, 2022
1 parent 4267d29 commit ca9347d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
8 changes: 2 additions & 6 deletions client/goal.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,14 +961,10 @@ TDNFSolvAddMinVersions(
sizeof(Map),
(void**)&pPool->considered);
map_init(pPool->considered, pPool->nsolvables);
map_setall(pPool->considered);
}
else
{
map_grow(pPool->considered, pPool->nsolvables);
}

map_setall(pPool->considered);
map_subtract(pPool->considered, pMapMinVersions);

cleanup:
if(pMapMinVersions)
{
Expand Down
16 changes: 5 additions & 11 deletions solv/tdnfpackage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,12 +1711,8 @@ SolvAddExcludes(
sizeof(Map),
(void**)&pPool->considered);
map_init(pPool->considered, pPool->nsolvables);
map_setall(pPool->considered);
}
else
{
map_grow(pPool->considered, pPool->nsolvables);
}
map_setall(pPool->considered);
map_subtract(pPool->considered, pExcludes);

cleanup:
Expand All @@ -1735,7 +1731,7 @@ SolvDataIterator(
{
Dataiterator di;
Id keyname = SOLVABLE_NAME;
char **ppszPackagesTemp = NULL;
char **ppszPkg = NULL;
uint32_t dwError = 0;

if (!pPool || !ppszExcludes || !pMap)
Expand All @@ -1744,22 +1740,20 @@ SolvDataIterator(
BAIL_ON_TDNF_ERROR(dwError);
}

ppszPackagesTemp = ppszExcludes;
while(ppszPackagesTemp && *ppszPackagesTemp)
for (ppszPkg = ppszExcludes; ppszPkg && *ppszPkg; ppszPkg++)
{
int flags = SEARCH_STRING;
if (SolvIsGlob(*ppszPackagesTemp))
if (SolvIsGlob(*ppszPkg))
{
flags = SEARCH_GLOB;
}
dwError = dataiterator_init(&di, pPool, 0, 0, keyname, *ppszPackagesTemp, flags);
dwError = dataiterator_init(&di, pPool, 0, 0, keyname, *ppszPkg, flags);
BAIL_ON_TDNF_ERROR(dwError);
while (dataiterator_step(&di))
{
MAPSET(pMap, di.solvid);
}
dataiterator_free(&di);
++ppszPackagesTemp;
}
cleanup:
return dwError;
Expand Down

0 comments on commit ca9347d

Please sign in to comment.