maintainers/scripts/haskell: sort case- and locale-insensitively consistently

sort -i actually means "ignore nonprinting", not "ignore case". Also, we
need to set LC_ALL to get proper sorting for "-".
This commit is contained in:
Wolfgang Walther 2025-04-24 18:02:06 +02:00
parent e2a42c12a3
commit b2bd43391d
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1
5 changed files with 647 additions and 647 deletions

View File

@ -35,19 +35,19 @@ trap "rm ${tmpfile}" 0
echo "Remember that you need to manually run 'maintainers/scripts/haskell/hydra-report.hs get-report' sometime before running this script."
echo "Generating a list of broken builds and displaying for manual confirmation ..."
maintainers/scripts/haskell/hydra-report.hs mark-broken-list $mark_broken_list_flags | sort -i > "$tmpfile"
maintainers/scripts/haskell/hydra-report.hs mark-broken-list $mark_broken_list_flags | LC_ALL=C.UTF-8 sort --ignore-case > "$tmpfile"
$EDITOR "$tmpfile"
tail -n +3 "$broken_config" >> "$tmpfile"
cat > "$broken_config" << EOF
# These packages don't compile.
broken-packages:
# These packages don't compile.
EOF
# clear environment here to avoid things like allowing broken builds in
sort -iu "$tmpfile" >> "$broken_config"
LC_ALL=C.UTF-8 sort --ignore-case --unique "$tmpfile" >> "$broken_config"
clear="env -u HOME -u NIXPKGS_CONFIG"
$clear maintainers/scripts/haskell/regenerate-hackage-packages.sh
evalline=$(maintainers/scripts/haskell/hydra-report.hs eval-info)

View File

@ -20,6 +20,6 @@ cat > $tmpfile << EOF
dont-distribute-packages:
EOF
nix-instantiate --eval --option restrict-eval true -I . --strict --json maintainers/scripts/haskell/transitive-broken-packages.nix | jq -r . | LC_ALL=C.UTF-8 sort -i >> $tmpfile
nix-instantiate --eval --option restrict-eval true -I . --strict --json maintainers/scripts/haskell/transitive-broken-packages.nix | jq -r . | LC_ALL=C.UTF-8 sort --ignore-case >> $tmpfile
mv $tmpfile $config_file

View File

@ -46,7 +46,7 @@ sed -r \
-e '/^with-compiler:/d' \
-e '/installed$/d' \
-e '/^$/d' \
< "${tmpfile}" | sort --ignore-case >"${tmpfile_new}"
< "${tmpfile}" | LC_ALL=C.UTF-8 sort --ignore-case >"${tmpfile_new}"
cat > $stackage_config << EOF
# Stackage $version