diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2025-04-01 14:50:37 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-01 14:50:37 -0300 |
commit | b3806d32c37d59e43d5c097ce112e2f4892dc46c (patch) | |
tree | acbb20a5423ba4cc328a81f100abad82bb252552 /scripts/generate-license-file | |
parent | f0be684f01b53482cb43e016a5c5c1faf3ae448e (diff) | |
parent | 5c4f7693ea8f3b908ceaf0945c9c6edfb4be89ec (diff) | |
download | meta-freescale-hardknott.tar.gz |
Merge pull request #2175 from mdrodrigo/topic/hardknotthardknott
Add update-license-file in hardknott branch
Diffstat (limited to 'scripts/generate-license-file')
-rwxr-xr-x | scripts/generate-license-file | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/generate-license-file b/scripts/generate-license-file new file mode 100755 index 00000000..b6d43cd9 --- /dev/null +++ b/scripts/generate-license-file | |||
@@ -0,0 +1,18 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # Create or clear the LICENSE file | ||
4 | echo "# License Information" > LICENSE | ||
5 | echo "" >> LICENSE | ||
6 | echo "This file lists all licenses used by recipes in the meta-freescale-3rdparty layer." >> LICENSE | ||
7 | echo "" >> LICENSE | ||
8 | |||
9 | # Find all .bb and .inc files and extract license information | ||
10 | find . -type f \( -name "*.bb" -o -name "*.inc" \) | while read -r file; do | ||
11 | # Extract the license line from each recipe file, if it exists | ||
12 | license_line=$(grep -i "^LICENSE" "$file") | ||
13 | if [ -n "$license_line" ]; then | ||
14 | echo "$file: $license_line" >> LICENSE | ||
15 | fi | ||
16 | done | ||
17 | |||
18 | echo "LICENSE file has been generated and updated with current recipe licenses." | ||