summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRasmus Villemoes <ravi@prevas.dk>2025-01-29 09:37:50 +0100
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2025-01-29 18:44:54 +0000
commita07ff6da170346c122f49c23aa8969960de023d0 (patch)
tree67edc005402d0f7cf4eb115063c71b9312eb1047 /scripts
parent85ebd29f11e0061139edc10c827310680d518d61 (diff)
downloadmeta-freescale-a07ff6da170346c122f49c23aa8969960de023d0.tar.gz
scripts: avoid pointless LICENSE churn
I was wondering why a bot decided to force-push a commit to a PR of mine. It turns out the script responsible for generating the LICENSE file is not deterministic, so depending on random file system layout we can end up regenerating the LICENSE without any actual change. For example: $ diff -u <(git show baf20676~1:LICENSE | sort) <(git show baf20676:LICENSE | sort) shows that baf20676 didn't provide any change at all in the actual contents, yet $ git show --stat baf20676 commit baf20676bcd2b454577449dbf7b0346d7080b880 Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Date: Wed Jan 22 21:42:44 2025 +0000 Auto-update LICENSE file with current recipe licenses LICENSE | 256 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------- 1 file changed, 128 insertions(+), 128 deletions(-) (cherry picked from commit 0602af4c78ef5a6ee5e64d2cf9202c22aa636b25)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/generate-license-file4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/generate-license-file b/scripts/generate-license-file
index 2f4e9766..02b45ab3 100755
--- a/scripts/generate-license-file
+++ b/scripts/generate-license-file
@@ -1,5 +1,7 @@
1#!/bin/bash 1#!/bin/bash
2 2
3export LC_ALL=C
4
3# Create or clear the LICENSE file 5# Create or clear the LICENSE file
4echo "# License Information" > LICENSE 6echo "# License Information" > LICENSE
5echo "" >> LICENSE 7echo "" >> LICENSE
@@ -7,7 +9,7 @@ echo "This file lists all licenses used by recipes in the meta-freescale layer."
7echo "" >> LICENSE 9echo "" >> LICENSE
8 10
9# Find all .bb and .inc files and extract license information 11# Find all .bb and .inc files and extract license information
10find . -type f \( -name "*.bb" -o -name "*.inc" \) | while read -r file; do 12find . -type f \( -name "*.bb" -o -name "*.inc" \) | sort | while read -r file; do
11 # Extract the license line from each recipe file, if it exists 13 # Extract the license line from each recipe file, if it exists
12 license_line=$(grep -i "^LICENSE" "$file") 14 license_line=$(grep -i "^LICENSE" "$file")
13 if [ -n "$license_line" ]; then 15 if [ -n "$license_line" ]; then