Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reposync fix infinite loop #509

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading