summaryrefslogtreecommitdiffstats
path: root/scripts/generate-license-file
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/generate-license-file')
-rwxr-xr-xscripts/generate-license-file20
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
3export LC_ALL=C
4
5# Create or clear the LICENSE file
6echo "# License Information" > LICENSE
7echo "" >> LICENSE
8echo "This file lists all licenses used by recipes in the meta-freescale layer." >> LICENSE
9echo "" >> LICENSE
10
11# Find all .bb and .inc files and extract license information
12find . -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
18done
19
20echo "LICENSE file has been generated and updated with current recipe licenses."