Hi Bruno,
On 3/21/24 2:26 PM, Bruno Haible wrote:
> if extra_files != [''] and extra_files:
> if extra_files != ['']:
> if buildaux_files != ['']:
>
> Why does [''] represent the empty set/list here? Is something wrong with the
> function filter_filelist?
Yes, sorry for the confusion. I thought that it looked strange as well
and probably should have commented about it in the original email.
My goal was to fix GLModule.getAutomakeSnippet_Unconditional without
making modifications to other existing code. Because I thought these
checks looked strange, I have confirmed they are necessary. This is
because filter_filelist can return a non-empty list with an empty
string:
print(bool([]))
False
print(bool(['']))
True
Therefore when changing the condition to:
if extra_files:
We see lines like this in lib/gnulib.mk.in:
+## begin gnulib module alignasof
+ifeq (,$(OMIT_GNULIB_MODULE_alignasof))
+
+
+EXTRA_DIST +=
+
+endif
+## end gnulib module alignasof
The extra_files != [''] prevents this. They were there before this
patch so I left it without changing filter_filelist.
> Prepending $(top_srcdir)/build-aux/ *after* having concatenated the file
> names?
> I would have expected that the code prepends $(top_srcdir)/build-aux/ to each
> file name, *before* combining the results to a single string.
Ah, yes sorry. Good catch. I was trying to fix the Emacs Makefile
which worked without this code. Therefore, I only had a *very* brief
glance over it. You are right though, it is incorrect. Thanks!
Collin