Skip to content

Commit

Permalink
Merge pull request #509 from vmware/topic/okurth/repopsync-fix-infini…
Browse files Browse the repository at this point in the history
…te-loop

reposync fix infinite loop
  • Loading branch information
oliverkurth authored Dec 11, 2024
2 parents 02ce419 + 260b66f commit 8ea0010
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/packageutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ TDNFPkgInfoFilterNewest(
{
pPkgInfo->pNext = ppPkgInfos[i];
pPkgInfo = ppPkgInfos[i];
pPkgInfo->pNext = NULL;
}
}

Expand Down
15 changes: 15 additions & 0 deletions pytests/tests/test_reposync.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,3 +432,18 @@ def test_reposync_newest(utils):
assert mulversion_pkgname_found

shutil.rmtree(synced_dir)


# reposync with --newest-only option caused an infinite loop
def test_reposync_newest_multiplerepos(utils):
reponame = "photon-srpms"
workdir = WORKDIR
utils.makedirs(workdir)

ret = utils.run(['tdnf',
'--enablerepo={}'.format(reponame),
'--newest-only',
'--urls',
'reposync'],
cwd=workdir)
assert ret['retval'] == 0

0 comments on commit 8ea0010

Please sign in to comment.