# HG changeset patch # User Franz Glasner # Date 1727434991 -7200 # Node ID 971ac60a2f94d9844081c9a92a4d67755833e435 # Parent 7800bac1fe7e657616af70a118656c20b84793d6 common.subr: Use LC_ALL=C.UTF-8 where appropriate. This is because JSON is relies on valid UTF-8 content in string values. diff -r 7800bac1fe7e -r 971ac60a2f94 share/local-bsdtools/common.subr --- a/share/local-bsdtools/common.subr Thu Sep 26 15:21:33 2024 +0200 +++ b/share/local-bsdtools/common.subr Fri Sep 27 13:03:11 2024 +0200 @@ -235,7 +235,7 @@ if [ -x "${JQ}" ]; then /sbin/mount -t zfs -p --libxo=json,no-locale \ - | LC_ALL=C "${JQ}" -r $'.mount.fstab[] | [.device, .mntpoint, .fstype, .opts, .dump, .pass] | @tsv ' \ + | LC_ALL=C.UTF-8 "${JQ}" -r $'.mount.fstab[] | [.device, .mntpoint, .fstype, .opts, .dump, .pass] | @tsv ' \ | { while IFS=$'\t' read -r _ds _mount _rest ; do if [ "$_mount" = "$_mountpoint" ]; then @@ -325,7 +325,7 @@ if [ -x "${JQ}" ]; then /usr/sbin/jls --libxo=json,no-locale -d dying name path \ - | LC_ALL=C "${JQ}" -r $'.["jail-information"].jail[] | [.dying, .name, .path] | @tsv ' \ + | LC_ALL=C.UTF-8 "${JQ}" -r $'.["jail-information"].jail[] | [.dying, .name, .path] | @tsv ' \ | { # ' while IFS=$'\t' read -r _dying _name _path ; do if [ "${_path}" = "${_location}" ]; then @@ -406,9 +406,9 @@ if [ -x "${JQ}" ]; then /sbin/mount -t zfs -p --libxo=json,no-locale \ - | LC_ALL=C "${JQ}" -r $'.mount.fstab[] | [.device, .mntpoint, .fstype, .opts, .dump, .pass] | @tsv ' \ - | LC_ALL=C /usr/bin/awk -F $'\\t+' -v OFS=$'\t' -v ds1="${_dsname}" -v ds2="${_dsname}/" $'{ if (($1 == ds1) || (index($1, ds2) == 1)) { print $1, $2, $3, $4, $5, $6; } }' \ - | LC_ALL=C /usr/bin/sort --field-separator=$'\t' --key=2 ${_opt_reversed} + | LC_ALL=C.UTF-8 "${JQ}" -r $'.mount.fstab[] | [.device, .mntpoint, .fstype, .opts, .dump, .pass] | @tsv ' \ + | LC_ALL=C.UTF-8 /usr/bin/awk -F $'\\t+' -v OFS=$'\t' -v ds1="${_dsname}" -v ds2="${_dsname}/" $'{ if (($1 == ds1) || (index($1, ds2) == 1)) { print $1, $2, $3, $4, $5, $6; } }' \ + | LC_ALL=C.UTF-8 /usr/bin/sort --field-separator=$'\t' --key=2 ${_opt_reversed} else # Check for unexpected spaces if ! check_for_proper_fstab; then @@ -487,9 +487,9 @@ esac if [ -x "${JQ}" ]; then /sbin/mount -p --libxo=json,no-locale \ - | LC_ALL=C "${JQ}" -r $'.mount.fstab[] | [.device, .mntpoint, .fstype, .opts, .dump, .pass] | @tsv ' \ - | LC_ALL=C /usr/bin/awk -F $'\\t+' -v OFS=$'\t' -v mp1="${_mp1}" -v mp2="${_mp2}" $'{ if (($2 == mp1) || (index($2, mp2) == 1)) { print; } }' \ - | LC_ALL=C /usr/bin/sort --field-separator=$'\t' --key=2 ${_opt_reversed} + | LC_ALL=C.UTF-8 "${JQ}" -r $'.mount.fstab[] | [.device, .mntpoint, .fstype, .opts, .dump, .pass] | @tsv ' \ + | LC_ALL=C.UTF-8 /usr/bin/awk -F $'\\t+' -v OFS=$'\t' -v mp1="${_mp1}" -v mp2="${_mp2}" $'{ if (($2 == mp1) || (index($2, mp2) == 1)) { print; } }' \ + | LC_ALL=C.UTF-8 /usr/bin/sort --field-separator=$'\t' --key=2 ${_opt_reversed} else # Check for unexpected spaces if ! check_for_proper_fstab; then