#57 Update Variable Type to Handle EPEL10 Branching
Closed by mymindstorm. Opened by thebeanogamer.
thebeanogamer/fedora-packages-static floatnotint  into  master

Download 57.patch

EPEL10 has started branching and doing point releases. The current variable parsing doesn't handle this, so swap from an int to a float when doing version comparisons.

Before:

$ make sync-repositories
mkdir -p repositories
bin/fetch-repository-dbs.py --target-dir repositories
Fetching active releases from Bodhi...
Traceback (most recent call last):
  File "/home/daniel/Git/Fedora/fedora-packages-static/bin/fetch-repository-dbs.py", line 437, in <module>
    main()
    ~~~~^^
  File "/home/daniel/Git/Fedora/fedora-packages-static/bin/fetch-repository-dbs.py", line 406, in main
    repo_url = get_repository_urls_for(product, version)
  File "/home/daniel/Git/Fedora/fedora-packages-static/bin/fetch-repository-dbs.py", line 339, in get_repository_urls_for
    elif product == "FEDORA-EPEL" and int(version) < 8:
                                      ~~~^^^^^^^^^
ValueError: invalid literal for int() with base 10: '10.0'
make: *** [Makefile:29: sync-repositories] Error 1

Now:

$ make sync-repositories
mkdir -p repositories
bin/fetch-repository-dbs.py --target-dir repositories
Fetching active releases from Bodhi...
Found: ['fedora-eln', 'fedora-eln-updates', 'fedora-eln-updates-testing', 'epel-10.0', 'epel-10.0-testing', 'epel-10', 'epel-10-testing', 'epel-8', 'epel-8-testing', 'epel-9', 'epel-9-testing', 'fedora-40', 'fedora-40-updates', 'fedora-40-updates-testing', 'fedora-41', 'fedora-41-updates', 'fedora-41-updates-testing', 'fedora-42', 'fedora-42-updates', 'fedora-42-updates-testing', 'fedora-rawhide']
fedora-eln             !! Failed to get 'https://dl.fedoraproject.org/pub/fedora/linux/releases/eln/Everything/x86_64/os/repodata/repomd.xml' <Response [404]>
fedora-eln-updates     !! Failed to get 'https://dl.fedoraproject.org/pub/fedora/linux/updates/eln/Everything/x86_64/repodata/repomd.xml' <Response [404]>
fedora-eln-updates-testing !! Failed to get 'https://dl.fedoraproject.org/pub/fedora/linux/updates/testing/eln/Everything/x86_64/repodata/repomd.xml' <Response [404]>
epel-10.0              Downloading file: https://dl.fedoraproject.org/pub/epel/10.0/Everything/x86_64/repodata//512b817d948b39a8ba5951473e4475622a293c7dc6507bd4e976f5e53f621bb0-primary.xml.gz to /tmp/fedorapkgs-ligzgbu_/repodata/512b817d948b39a8ba5951473e4475622a293c7dc6507bd4e976f5e53f621bb0-primary.xml.gz
512b817d948b39a8ba5951473e4475622a293c7dc6507bd4e976f5e53f621bb0-primary.xml.gz: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.53M/2.53M [00:00<00:00, 3.90MB/s]
epel-10.0              Downloading file: https://dl.fedoraproject.org/pub/epel/10.0/Everything/x86_64/repodata//79fc750db611a19c626c1d88629717959ff23b85ba1365264c59adb66eec6ba5-filelists.xml.gz to /tmp/fedorapkgs-ligzgbu_/repodata/79fc750db611a19c626c1d88629717959ff23b85ba1365264c59adb66eec6ba5-filelists.xml.gz
79fc750db611a19c626c1d88629717959ff23b85ba1365264c59adb66eec6ba5-filelists.xml.gz: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.44M/6.44M [00:00<00:00, 7.14MB/s]
epel-10.0              Downloading file: https://dl.fedoraproject.org/pub/epel/10.0/Everything/x86_64/repodata//9a170791ad50620bc9d20420093d172ec6d5a5bd709732f9957277c1dab71651-other.xml.gz to /tmp/fedorapkgs-ligzgbu_/repodata/9a170791ad50620bc9d20420093d172ec6d5a5bd709732f9957277c1dab71651-other.xml.gz
9a170791ad50620bc9d20420093d172ec6d5a5bd709732f9957277c1dab71651-other.xml.gz: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.26M/1.26M [00:00<00:00, 2.13MB/s]
epel-10.0              Downloading file: https://dl.fedoraproject.org/pub/epel/10.0/Everything/x86_64/repodata//3914293e260dad72b373aba8d499eb37855b895ef395552741dc132f9dfa91fd-prestodelta.xml.gz to /tmp/fedorapkgs-ligzgbu_/repodata/3914293e260dad72b373aba8d499eb37855b895ef395552741dc132f9dfa91fd-prestodelta.xml.gz
3914293e260dad72b373aba8d499eb37855b895ef395552741dc132f9dfa91fd-prestodelta.xml.gz: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.61k/2.61k [00:00<00:00, 27.2MB/s]
epel-10.0              Downloading file: https://dl.fedoraproject.org/pub/epel/10.0/Everything/x86_64/repodata//59c16adab3d0b58e7d0dc39282d0a105b63c7820edb1fb4c42fc2f3c718f7527-updateinfo.xml.bz2 to /tmp/fedorapkgs-ligzgbu_/repodata/59c16adab3d0b58e7d0dc39282d0a105b63c7820edb1fb4c42fc2f3c718f7527-updateinfo.xml.bz2
59c16adab3d0b58e7d0dc39282d0a105b63c7820edb1fb4c42fc2f3c718f7527-updateinfo.xml.bz2: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 0.98M/0.98M [00:00<00:00, 1.68MB/s]
type group added to list from path: /tmp/fedorapkgs-ligzgbu_/repodata/3adf4db623047aeddec1d55f9d675ad1bb9d20dff8d4c5ab9726641687b3235d-comps-Everything.x86_64.xml 
type prestodelta added to list from path: /tmp/fedorapkgs-ligzgbu_/repodata/3914293e260dad72b373aba8d499eb37855b895ef395552741dc132f9dfa91fd-prestodelta.xml.gz 
type updateinfo added to list from path: /tmp/fedorapkgs-ligzgbu_/repodata/59c16adab3d0b58e7d0dc39282d0a105b63c7820edb1fb4c42fc2f3c718f7527-updateinfo.xml.bz2 
Preparing sqlite DBs
...

Worth noting that even with this fix the site doesn't build, it's failing to parse even the old EPEL repos

$ make fetch-data html                 
curl https://src.fedoraproject.org/extras/pagure_owner_alias.json -o pagure_owner_alias.json
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2807k  100 2807k    0     0  1911k      0  0:00:01  0:00:01 --:--:-- 1910k
bin/get-product-names.py
mkdir -p public_html/assets
cp -r assets/* public_html/assets
cp assets/images/favicon.ico public_html/
bin/generate-html.py --target-dir public_html
Loading maintainer mapping...
Loading release name mapping...
Invalid object in repositories: epel-10.0_primary.sqlite
make: *** [Makefile:39: html] Error 1

Will try and do another PR for this when I get time

I tried this myself. All you have to do is to convert the float back to an int:

int(float(version))

The rest of the program still assumes that the version is an integer, and so this conversion is necessary. In particular, the db_pattern regex in generate-html.py fails to match against floating point version numbers, and that's why you saw the error.

After fixing this, make builds the whole project without error. When I try to run the container, though, some SELinux policy error prevents solr from running. It happened to both docker and podman, though I'm not sure if the same issues will happen in the CI pipeline.

Never mind. That doesn't work. It was something else I did that fixed it: I manually deleted all the epel-10.0* files in the repositories directory. This is of course not a good permanent solution.

The main issue here is that we have both EPEL 10.0 and EPEL 10.1 on Bodhi. The fact that EPEL 10.1's version string is '10' makes things worse. I filed an issue on Bodhi's repository.

{'name': 'EPEL-10.0', 'long_name': 'Fedora EPEL 10.0', 'version': '10.0', 'id_prefix': 'FEDORA-EPEL', 'branch': 'epel10.0', 'dist_tag': 'epel10.0', 'stable_tag': 'epel10.0', 'testing_tag': 'epel10.0-testing', 'candidate_tag': 'epel10.0-testing-candidate', 'pending_signing_tag': 'epel10.0-signing-pending', 'pending_testing_tag': 'epel10.0-testing-pending', 'pending_stable_tag': 'epel10.0-pending', 'override_tag': 'epel10.0-override', 'mail_template': 'fedora_epel_legacy_errata_template', 'state': 'current', 'composed_by_bodhi': True, 'create_automatic_updates': False, 'package_manager': 'unspecified', 'testing_repository': None, 'released_on': None, 'eol': None, 'critpath_mandatory_days_in_testing': 14, 'mandatory_days_in_testing': 7, 'critpath_min_karma': 2, 'min_karma': 1, 'setting_status': None}
{'name': 'EPEL-10.1', 'long_name': 'Fedora EPEL 10.1', 'version': '10', 'id_prefix': 'FEDORA-EPEL', 'branch': 'epel10', 'dist_tag': 'epel10.1', 'stable_tag': 'epel10.1', 'testing_tag': 'epel10.1-testing', 'candidate_tag': 'epel10.1-testing-candidate', 'pending_signing_tag': 'epel10.1-signing-pending', 'pending_testing_tag': 'epel10.1-testing-pending', 'pending_stable_tag': 'epel10.1-pending', 'override_tag': 'epel10.1-override', 'mail_template': 'fedora_epel_legacy_errata_template', 'state': 'current', 'composed_by_bodhi': True, 'create_automatic_updates': False, 'package_manager': 'unspecified', 'testing_repository': None, 'released_on': None, 'eol': None, 'critpath_mandatory_days_in_testing': 14, 'mandatory_days_in_testing': 7, 'critpath_min_karma': 2, 'min_karma': 1, 'setting_status': None}

That aside, changing a few regex patterns to allow . to appear in version numbers fixed it on my end. I also got docker to work after making SELinux happy.

FYI, using just version 10 for the leading minor version of EPEL 10 was part of our original plan, but we are adjusting this plan due to some other issues.

If there are any more questions about EPEL 10 I'd be happy to help.

Update:

Turns out the Bodhi version number issue is intentional, so as long as it remains an int/float, we shouldn't have to worry about future changes breaking Fedora Packages.

I added one more commit on top of this PR to fix the regexps and submitted them in PR #59

Hey, y'all sorry for the lateness. I am in desperate need of co-maintainers. @thebeanogamer if you are interested, please shoot me an email. I'll merge @lihaohong 's PR incorporating this change and deploy shortly.

Pull-Request has been closed by mymindstorm

Metadata