diff options
Diffstat (limited to 'scripts/generate-license-file')
-rwxr-xr-x | scripts/generate-license-file | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/generate-license-file b/scripts/generate-license-file new file mode 100755 index 000000000..02b45ab30 --- /dev/null +++ b/scripts/generate-license-file | |||
@@ -0,0 +1,20 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | export LC_ALL=C | ||
4 | |||
5 | # Create or clear the LICENSE file | ||
6 | echo "# License Information" > LICENSE | ||
7 | echo "" >> LICENSE | ||
8 | echo "This file lists all licenses used by recipes in the meta-freescale layer." >> LICENSE | ||
9 | echo "" >> LICENSE | ||
10 | |||
11 | # Find all .bb and .inc files and extract license information | ||
12 | find . -type f \( -name "*.bb" -o -name "*.inc" \) | sort | while read -r file; do | ||
13 | # Extract the license line from each recipe file, if it exists | ||
14 | license_line=$(grep -i "^LICENSE" "$file") | ||
15 | if [ -n "$license_line" ]; then | ||
16 | echo "$file: $license_line" >> LICENSE | ||
17 | fi | ||
18 | done | ||
19 | |||
20 | echo "LICENSE file has been generated and updated with current recipe licenses." | ||