projects-dir.mk: list-files: Don't use /usr/bin/file

/usr/bin/file <candidate> | grep text is used to detect if a file is
a text file or not. Replace that with grep -I., because that adds
some files left out by /usr/bin/file, notably systemd service files.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-10 09:08:33 +02:00
commit 30c4d7101f

View file

@ -221,7 +221,7 @@ list-files:
$(TEXT_FILES_CACHE): $(TEXT_FILES_CACHE):
$(Q)make -s text-files-update $(Q)make -s text-files-update
text-files-update: text-files-update:
make -s --no-print-directory list-files | tr '\n' '\0' | xargs -0 file -N | sed "/:.*text/I !d; s/:.*//" > $(TEXT_FILES_CACHE).tmp make -s --no-print-directory list-files | tr '\n' '\0' | xargs -0 grep -d skip -Il . > $(TEXT_FILES_CACHE).tmp 2>/dev/null || true
mv $(TEXT_FILES_CACHE).tmp $(TEXT_FILES_CACHE) mv $(TEXT_FILES_CACHE).tmp $(TEXT_FILES_CACHE)
text-files-update-all: text-files-update-all:
$(Q)PROJECTS_TXT= make text-files-update $(Q)PROJECTS_TXT= make text-files-update