@@ -23,10 +23,25 @@ def numeric(distro)
2323def latest_nginx_available_parts ( release , distro )
2424 arch = "x86_64"
2525 url = case distro
26- when :rocky then "https://dl.rockylinux.org/pub/rocky/#{ numeric ( release ) } /AppStream/ #{ arch } /os/Packages/n/ "
27- when :alma then "https://repo.almalinux.org/almalinux/#{ numeric ( release ) } /AppStream/ #{ arch } /os/Packages/ "
28- when :rhel then "https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi#{ numeric ( release ) } /#{ numeric ( release ) } / #{ arch } /appstream/os/Packages/n/ "
26+ when :rocky then "https://dl.rockylinux.org/pub/rocky/#{ numeric ( release ) } "
27+ when :alma then "https://repo.almalinux.org/almalinux/#{ numeric ( release ) } "
28+ when :rhel then "https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi#{ numeric ( release ) } /#{ numeric ( release ) } "
2929 end
30+
31+ if release < 10
32+ url += case distro
33+ when :rocky then "/AppStream/#{ arch } /os/Packages/n/"
34+ when :alma then "/AppStream/#{ arch } /os/Packages/"
35+ when :rhel then "/#{ arch } /appstream/os/Packages/n/"
36+ end
37+ else
38+ url += case distro
39+ when :rocky then "/devel/#{ arch } /os/Packages/n/"
40+ when :alma then "/CRB/#{ arch } /os/Packages/"
41+ when :rhel then "/#{ arch } /appstream/os/Packages/n/" # path for nginx-mod-stream because nginx-mod-devel not in ubi10
42+ end
43+ end
44+
3045 cache_file = "/tmp/#{ distro } _#{ release } _nginx_version.txt"
3146 if !File . exist? ( cache_file ) || ( ( Time . now - 60 *60 *24 ) > File . mtime ( cache_file ) )
3247 if RUBY_VERSION >= '2.5'
@@ -39,7 +54,7 @@ def latest_nginx_available_parts(release, distro)
3954 end
4055 end
4156 version_parts = doc
42- . css ( 'a[href^="nginx-"]' )
57+ . css ( 'a[href^="nginx-mod- "]' ) # cannot use full nginx-mod-devel name because ubi10 doesn't include that package for some reason
4358 . map { |el | el [ 'href' ] }
4459 . reject { |s | [ "-mod-" , ".noarch." , "-core-" ] . any? { |p | s . include? ( p ) } }
4560 . map { |url | URI . decode_uri_component ( url ) . delete_suffix ( ".#{ arch } .rpm" ) . split ( '-' ) . slice ( 1 ..) }
0 commit comments