license-check.sh: Use '--' with slightly untrusted filenames

Names from git ls-files should be safe but if one runs it on
a tree without the .git dir and there are extra files, it's
safer to have the end of arguments marked with '--'.
This commit is contained in:
Lasse Collin 2024-05-27 17:45:51 +03:00
parent fda0ec862a
commit d28a4b2520
1 changed files with 3 additions and 3 deletions

View File

@ -100,11 +100,11 @@ FILES=$(printf '%s\n' "$FILES" | sort)
# Find the tagged files. # Find the tagged files.
TAGGED=$(printf '%s\n' "$FILES" \ TAGGED=$(printf '%s\n' "$FILES" \
| tr '\n' '\000' | xargs -0r grep -l "$SPDX_LI") | tr '\n' '\000' | xargs -0r grep -l "$SPDX_LI" --)
# Find the tagged 0BSD files. # Find the tagged 0BSD files.
TAGGED_0BSD=$(printf '%s\n' "$TAGGED" \ TAGGED_0BSD=$(printf '%s\n' "$TAGGED" \
| tr '\n' '\000' | xargs -0r grep -l "$SPDX_LI 0BSD") | tr '\n' '\000' | xargs -0r grep -l "$SPDX_LI 0BSD" --)
# Find the tagged non-0BSD files, that is, remove the 0BSD-tagged files # Find the tagged non-0BSD files, that is, remove the 0BSD-tagged files
# from the list of tagged files. # from the list of tagged files.
@ -127,7 +127,7 @@ FILES=$(printf '%s\n' "$FILES" | grep -Ev \
# These are old translations that haven't been updated after 2024-02-14. # These are old translations that haven't been updated after 2024-02-14.
# Eventually these should go away. # Eventually these should go away.
PD_PO=$(printf '%s\n' "$FILES" | grep '\.po$' | tr '\n' '\000' \ PD_PO=$(printf '%s\n' "$FILES" | grep '\.po$' | tr '\n' '\000' \
| xargs -0r grep -Fl '# This file is put in the public domain.') | xargs -0r grep -Fl '# This file is put in the public domain.' --)
if test -n "$PD_PO"; then if test -n "$PD_PO"; then
# Remove the public domain .po files from the list. # Remove the public domain .po files from the list.