Skip to content

Commit 0602af4

Browse files
committed
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 baf2067~1:LICENSE | sort) <(git show baf2067:LICENSE | sort) shows that baf2067 didn't provide any change at all in the actual contents, yet $ git show --stat baf2067 commit baf2067 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(-)
1 parent 4738bf9 commit 0602af4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/generate-license-file

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash
22

3+
export LC_ALL=C
4+
35
# Create or clear the LICENSE file
46
echo "# License Information" > LICENSE
57
echo "" >> LICENSE
68
echo "This file lists all licenses used by recipes in the meta-freescale layer." >> LICENSE
79
echo "" >> LICENSE
810

911
# Find all .bb and .inc files and extract license information
10-
find . -type f \( -name "*.bb" -o -name "*.inc" \) | while read -r file; do
12+
find . -type f \( -name "*.bb" -o -name "*.inc" \) | sort | while read -r file; do
1113
# Extract the license line from each recipe file, if it exists
1214
license_line=$(grep -i "^LICENSE" "$file")
1315
if [ -n "$license_line" ]; then

0 commit comments

Comments
 (0)