From b1de39d9c64cabf7c40c29d445e135b0e41a3f0b Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 23 Sep 2022 19:02:02 -0500 Subject: [PATCH] Add new %ansible_collection_filelist macro %ansible_collection_files cannot be adapted to dynamically determine the collection namespace. We need to use a file list for that. %ansible_collection_install writes out a file list to %ansible_collection_filelist. Packagers would pass `%{ansible_collection_filelist}` to `%files -f`. Eventually, I'd like to deprecate %ansible_collection_files. That won't happen until the new approach has gotten more testing and adoption. --- macros.ansible | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/macros.ansible b/macros.ansible index 0c81432..57c89fe 100644 --- a/macros.ansible +++ b/macros.ansible @@ -18,5 +18,11 @@ --python-interpreter %{__python3} --local %{?*} } +# TODO: Officially deprecate this macro and add the following line to the macro +# def after the new approach has gotten more testing and adoption: +# %%{warn: %%{ansible_collection_files} is deprecated. Use %%files -f %%{ansible_collection_filelist} instead.} +%ansible_collection_files %{shrink: +%{ansible_collections_dir}/%{collection_namespace}/ +} -%ansible_collection_files %{_datadir}/ansible/collections/ansible_collections/%{collection_namespace}/ +%ansible_collection_filelist %{__ansible_builddir}/ansible_collection_files