diff options
author | Abner C. Paula <abner.cordeiro@ossystems.com.br> | 2024-12-05 08:50:26 -0300 |
---|---|---|
committer | Rodrigo M. Duarte <rodrigo.duarte@ossystems.com.br> | 2025-04-01 14:53:49 -0300 |
commit | 92a20d902d18cb9f0f762e5c7ab6278d49b48071 (patch) | |
tree | 8aceb3b0bcfd48a2be08a03b3111319dd3bc0ca1 /scripts/generate-license-file | |
parent | 501032fb30abbad54616a2d9bb4555c297fc35b6 (diff) | |
download | meta-freescale-92a20d902d18cb9f0f762e5c7ab6278d49b48071.tar.gz |
Add workflow to automatically update LICENSE file with recipe licenses
Originally from meta-freescale-3rdparty.
Signed-off-by: Abner C. Paula <abner.cordeiro@ossystems.com.br>
(cherry picked from commit 77f6565f4ac5d9a57dc49abafa04dca07cb2979a)
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." | ||