Expand listfiles_include and listfiles_exclude in condition

listfiles_include and listfiles_exclude can contain multiline data that should be expanded, otherwise it breaks the if condition on newlines.
This commit is contained in:
Robert-André Mauchin 2019-06-24 22:47:59 +00:00
parent c68c6bd353
commit 29b504fa55

View File

@ -12,9 +12,9 @@
# Arguments passed to the macro without flags will be interpreted as inclusion # Arguments passed to the macro without flags will be interpreted as inclusion
# globs. # globs.
%listfiles(i:x:) %{expand: %listfiles(i:x:) %{expand:
%if "%{?-i*}%{?listfiles_include}%*" != "" %if "%{?-i*}%{expand:?listfiles_include}%*" != ""
listfiles_include=$(realpath -e --relative-base=. %{?-i*} %{?listfiles_include} %* | sort -u) listfiles_include=$(realpath -e --relative-base=. %{?-i*} %{?listfiles_include} %* | sort -u)
%if "%{?-x*}%{?listfiles_exclude}" != "" %if "%{?-x*}%{expand:?listfiles_exclude}" != ""
while IFS= read -r finc ; do while IFS= read -r finc ; do
realpath -qe --relative-base=. %{?-x*} %{?listfiles_exclude} \\ realpath -qe --relative-base=. %{?-x*} %{?listfiles_exclude} \\
| sort -u | grep -q "${finc}" || echo "${finc}" | sort -u | grep -q "${finc}" || echo "${finc}"