Replace create_lang_packages macro with its Lua code

This works around an RPM change in the processing of macro argument lists.
Newer RPM versions split the argument list, so that %1 contains just eo,
and not the whole language list.

Instead, use %language_list directly.  This is compatible with earlier
RPM versions, too.
This commit is contained in:
Florian Weimer 2017-08-16 13:17:21 +02:00
parent d8b4ab633b
commit 9df65054b7
1 changed files with 5 additions and 8 deletions

View File

@ -567,14 +567,11 @@ to support the %{1} language in your applications.\
# translations. # translations.
%define language_list eo %(cat %{SOURCE11} | grep -E '^[a-z]+_' | cut -d _ -f 1 | sort -u | tr "\\\\n" " " | sed 's/ $//') %define language_list eo %(cat %{SOURCE11} | grep -E '^[a-z]+_' | cut -d _ -f 1 | sort -u | tr "\\\\n" " " | sed 's/ $//')
%define create_lang_packages()\ %{lua:
%{lua:\ local languages = rpm.expand("%language_list")
local languages = rpm.expand("%1")\ string.gsub(languages, "(%a+)",
string.gsub(languages, "(%a+)",\ function(i) print(rpm.expand("%lang_package "..i.."")) end)
function(i) print(rpm.expand("%lang_package "..i.."")) end)}\ }
%{nil}
%create_lang_packages %language_list
# The glibc-all-langpacks provides the virtual glibc-langpack, # The glibc-all-langpacks provides the virtual glibc-langpack,
# and thus satisfies glibc's requirement for installed locales. # and thus satisfies glibc's requirement for installed locales.