%ansible_collection_url: handle new URL scheme

epel8
Maxwell G 1 year ago
parent 47142722f2
commit 168a1f7535
No known key found for this signature in database
GPG Key ID: F79E4E25E8C661F8

@ -2,7 +2,7 @@
Name: ansible-packaging Name: ansible-packaging
Version: 1 Version: 1
Release: 11%{?dist} Release: 12%{?dist}
Summary: RPM packaging macros and generators for Ansible collections Summary: RPM packaging macros and generators for Ansible collections
License: GPL-3.0-or-later License: GPL-3.0-or-later
@ -117,17 +117,19 @@ echo
echo echo
echo "Ensure macro works when both arguments are passed and no control macros are set" echo "Ensure macro works when both arguments are passed and no control macros are set"
[ "$(rpm_eval -E '%%ansible_collection_url community general')" = \ [ "$(rpm_eval -E '%%ansible_collection_url community general')" = \
"https://galaxy.ansible.com/community/general" ] "https://galaxy.ansible.com/ui/repo/published/community/general" ]
echo echo
echo "Ensure macro works with the control macros" echo "Ensure macro works with the control macros"
[ "$(rpm_eval -D 'collection_namespace ansible' -D 'collection_name posix' \ [ "$(rpm_eval -D 'collection_namespace ansible' -D 'collection_name posix' \
-E '%%ansible_collection_url')" = "https://galaxy.ansible.com/ansible/posix" ] -E '%%ansible_collection_url')" = \
"https://galaxy.ansible.com/ui/repo/published/ansible/posix" ]
echo echo
echo "Ensure macro prefers the collection namespace and name passed as an argument over the control macros" echo "Ensure macro prefers the collection namespace and name passed as an argument over the control macros"
[ "$(rpm_eval -D 'collection_namespace ansible' -D 'collection_name posix' \ [ "$(rpm_eval -D 'collection_namespace ansible' -D 'collection_name posix' \
-E '%%ansible_collection_url community general')" = "https://galaxy.ansible.com/community/general" ] -E '%%ansible_collection_url community general')" = \
"https://galaxy.ansible.com/ui/repo/published/community/general" ]
@ -151,6 +153,9 @@ echo "Ensure macro prefers the collection namespace and name passed as an argume
%changelog %changelog
* Tue Dec 05 2023 Maxwell G <maxwell@gtmx.me> - 1-12
- %%ansible_collection_url: handle new URL scheme
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1-11 * Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

@ -8,6 +8,9 @@
# either or approach. Both arguments must be passed OR both control macros must # either or approach. Both arguments must be passed OR both control macros must
# be defined. # be defined.
%__ansible_galaxy_collection_url https://galaxy.ansible.com/ui/repo/published
%ansible_collection_url() %{lua: %ansible_collection_url() %{lua:
local namespace_name = nil local namespace_name = nil
if rpm.expand("%collection_namespace") ~= "%collection_namespace" if rpm.expand("%collection_namespace") ~= "%collection_namespace"
@ -21,5 +24,6 @@
rpm.expand("%{error:%%ansible_collection_url: You must pass the collection " .. rpm.expand("%{error:%%ansible_collection_url: You must pass the collection " ..
"namespace as the first arg and the collection name as the second}") "namespace as the first arg and the collection name as the second}")
end end
print("https://galaxy.ansible.com/" .. namespace_name) url = rpm.expand("%__ansible_galaxy_collection_url")
print(url .. "/" .. namespace_name)
} }

Loading…
Cancel
Save