mirror of
https://gitlab.com/d3tn/ud3tn.git
synced 2026-08-13 12:33:27 +02:00
This adds the Nanopb library as submodule under `external/` and adds corresponding build configuration to the Makefiles. Additionally, a Protobuf stub for AAP 2.0 is included along with a `make` target to build the corresponding C language files (`aap2-proto-headers`). Signed-off-by: Felix Walter <felix.walter@d3tn.com>
37 lines
1,021 B
Bash
Executable file
37 lines
1,021 B
Bash
Executable file
#!/bin/bash
|
|
# SPDX-License-Identifier: BSD-3-Clause OR Apache-2.0
|
|
|
|
if [ ! -e ./LICENSE ] || [ ! -e ./README.md ]; then
|
|
echo "Please run this script from the project root!"
|
|
exit 1
|
|
fi
|
|
|
|
SPDX_LICENSE_STR="SPDX-License-Identifier: $(head -n 1 LICENSE)"
|
|
echo 'Searching for SPDX expression "'"$SPDX_LICENSE_STR"'"'
|
|
|
|
DIRS="components doc dockerfiles include mk pyd3tn python-ud3tn-utils tools test"
|
|
FILES=$(find $DIRS -type f \( -name "*.[ch]" -o -name "*.proto" -o -name "*.py" -o -name "*.rs" -o -name "*.sh" \) )
|
|
declare -a MISSING_SPDX_FILES
|
|
|
|
for file in $FILES; do
|
|
head -n 2 "$file" | grep -q --fixed-strings "$SPDX_LICENSE_STR"
|
|
if [ $? -ne 0 ]; then
|
|
MISSING_SPDX_FILES+=("$file")
|
|
fi
|
|
done
|
|
|
|
grep -q --fixed-strings "$SPDX_LICENSE_STR" README.md
|
|
if [ $? -ne 0 ]; then
|
|
MISSING_SPDX_FILES+=("README.md")
|
|
fi
|
|
|
|
if [ ${#MISSING_SPDX_FILES[@]} -gt 0 ]; then
|
|
echo
|
|
echo "SPDX expression not found in the following files:"
|
|
echo
|
|
printf '%s\n' "${MISSING_SPDX_FILES[@]}"
|
|
exit 1
|
|
else
|
|
echo "Looks good :-)"
|
|
fi
|
|
|