From afe74d88a41151fc25a6416342f336eeeb18d91f Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Mon, 9 Oct 2023 10:39:18 -0700 Subject: [PATCH] bodhi / new-updates-sync / epel7: fix epel7 latest release sync Recently (possibly with the new python in fedora 38), the updates-sync logic that updates the 'latest' link for epel-release rpms has started replacing it everytime it runs. Since this is every minute, it sometimes results in people getting odd perm denied errors when they try and fetch it as it's being removed or updated. The problem seems to be that the script looks for all epel-release*noarch* packages under a release tree and then links to the x86_64 one. With all the other epel branches, x86_64 was the last one it saw with the file glob, so everything was fine. For some reason on epel7 now, it's seeing them in the following order: /pub/epel/7/ppc64/Packages/e/epel-release-7-11.noarch.rpm /pub/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm /pub/epel/7/ppc64le/Packages/e/epel-release-7-14.noarch.rpm /pub/epel/7/aarch64/Packages/e/epel-release-7-12.noarch.rpm This means it sees the 'aarch64' one last and since it's not = to the x86_64 one, it replaces it. Luckily it's hard coded to use the x86_64 one so the link is always the same, it's just never equal to the one it's checking against. I am not sure why this is happening only on epel7, but this PR just sorts all the path's so that x86_64 is always 'last' and should match up. Signed-off-by: Kevin Fenzi --- roles/bodhi2/backend/files/new-updates-sync | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/bodhi2/backend/files/new-updates-sync b/roles/bodhi2/backend/files/new-updates-sync index 0df4b7c2c3..95e0bf8b39 100755 --- a/roles/bodhi2/backend/files/new-updates-sync +++ b/roles/bodhi2/backend/files/new-updates-sync @@ -493,7 +493,7 @@ def get_epel_release_rel_path(release, epel_next=False): if 'Packages' in str(path) and 'x86_64' in str(path): pkg_relpath = os.path.relpath(path,EPELDEST) else: - for path in Path(RELEASES[release]['repos']['epel']['to'][0]['dest']).rglob('epel-release*noarch*'): + for path in sorted(Path(RELEASES[release]['repos']['epel']['to'][0]['dest']).rglob('epel-release*noarch*')): if 'Packages' in str(path) and 'x86_64' in str(path): pkg_relpath = os.path.relpath(path,EPELDEST) return path, pkg_relpath