ci: reproducible license sort

This commit is contained in:
Ben Grande 2024-07-08 19:08:01 +02:00
parent 49fb82a177
commit 6eb13fa07f
No known key found for this signature in database
GPG Key ID: 00C64E14F51F9E56
2 changed files with 2 additions and 8 deletions

View File

@ -40,12 +40,6 @@ jobs:
- name: Install OS packages
# yamllint disable-line rule:line-length
run: sudo apt-get install -y $(cat dependencies/debian.txt)
- name: Show how licenses are rendered order
run: |
reuse --root salt/dom0 lint || true
./scripts/spec-get.sh dom0 license
./scripts/spec-get.sh dom0 license_csv
./scripts/spec-gen.sh test dom0
- name: Remove externally managed python environment flag
# yamllint disable-line rule:line-length
run: sudo dpkg-divert --rename --add /usr/lib/$(py3versions -d)/EXTERNALLY-MANAGED

View File

@ -88,8 +88,8 @@ fi
if test "${key}" = "license" || test "${key}" = "license_csv"; then
license_csv="$(reuse --root "${project_dir}" lint |
awk -F ':' '/^\* Used licenses:/{print $2}' | tr " " "\n" | sort -d |
tr -s "\n" " " | tr -d " ")"
awk -F ':' '/^\* Used licenses:/{print $2}' | tr " " "\n" | tr -d "," |
sort -d | tr -s "\n" "," | sed "s/^\,//;s/\,$//")"
license="$(echo "${license_csv}" | sed "s/\,/ AND /g")"
fi