meta-freescale-3rdparty/scripts/generate-license-file
Abner C. Paula 3ee87aca07 generate-license-file: Move script to scripts folder
This commit also adds if condition to check license file change.
It is to avoid empty commits.

Signed-off-by: Abner C. Paula <abner.cordeiro@ossystems.com.br>
2024-12-04 09:33:39 -03:00

19 lines
656 B
Bash
Executable File

#!/bin/bash
# Create or clear the LICENSE file
echo "# License Information" > LICENSE
echo "" >> LICENSE
echo "This file lists all licenses used by recipes in the meta-freescale-3rdparty layer." >> LICENSE
echo "" >> LICENSE
# Find all .bb and .inc files and extract license information
find . -type f \( -name "*.bb" -o -name "*.inc" \) | while read -r file; do
# Extract the license line from each recipe file, if it exists
license_line=$(grep -i "^LICENSE" "$file")
if [ -n "$license_line" ]; then
echo "$file: $license_line" >> LICENSE
fi
done
echo "LICENSE file has been generated and updated with current recipe licenses."