aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2023-10-11 07:54:12 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2023-10-11 07:56:27 +0000
commit9fee35128080f036c7b318cbbe20067ccca409db (patch)
treec6dfa3c0e24a3cad296280761ebc8eaeadad8492
parent27b1250d59828d57dde36cb34a9fe5fbf51049c4 (diff)
downloadports-9fee35128080f036c7b318cbbe20067ccca409db.tar.gz
ports-9fee35128080f036c7b318cbbe20067ccca409db.zip
dialog: force UTF-8 locale
On some terminal, namely "putty" and "linux", the unicode capability are not properly exposed, resulting in a not so nice UI, forcing the env to be unicode friendly with executing the DIDALOG commnands make the output nice in those environements
-rw-r--r--Mk/Scripts/dialog4ports.sh4
-rw-r--r--Mk/bsd.licenses.mk10
2 files changed, 7 insertions, 7 deletions
diff --git a/Mk/Scripts/dialog4ports.sh b/Mk/Scripts/dialog4ports.sh
index de62a91b583f..ba8dbb7cd48d 100644
--- a/Mk/Scripts/dialog4ports.sh
+++ b/Mk/Scripts/dialog4ports.sh
@@ -42,9 +42,9 @@ fi
# Clear environment of PKGNAME or the dialog will show on older versions
# that do not understand -v.
if ! env -u PKGNAME ${DIALOG4PORTS} -v > /dev/null 2>&1; then
- exec $DIALOG4PORTS > $OPTIONSFILE 2>&1
+ exec env LC_ALL=C.UTF-8 $DIALOG4PORTS > $OPTIONSFILE 2>&1
fi
# Newer versions use stderr to work around a jail issue
# http://lists.freebsd.org/pipermail/freebsd-ports/2013-March/082383.html
-exec $DIALOG4PORTS 2> $OPTIONSFILE
+exec env LC_ALL=C.UTF-8 $DIALOG4PORTS 2> $OPTIONSFILE
diff --git a/Mk/bsd.licenses.mk b/Mk/bsd.licenses.mk
index f9332996207b..cc3b8f29f478 100644
--- a/Mk/bsd.licenses.mk
+++ b/Mk/bsd.licenses.mk
@@ -645,7 +645,7 @@ ${_LICENSE_COOKIE}:
. if !defined(NO_LICENSES_DIALOGS)
# Dialog interface
. if ${_LICENSE_COMB} == "single"
- @${DIALOG} --title "License for ${PKGNAME} (${_LICENSE})" \
+ @${SETENV} LC_ALL=C.UTF-8 ${DIALOG} --title "License for ${PKGNAME} (${_LICENSE})" \
--yes-label Accept --no-label Reject --yesno \
"$$(${CAT} ${_LICENSE_FILE})" 21 76
@@ -662,13 +662,13 @@ ${_LICENSE_COOKIE}:
done; \
menu_cmd="$${menu_cmd} REJECT \"Reject the licenses (all)\""; \
while true; do \
- ${SH} -c "$${menu_cmd} 2>\"$${tmpfile}\""; \
+ ${SH} -c "${SETENV} LC_ALL=C.UTF-8 $${menu_cmd} 2>\"$${tmpfile}\""; \
result=$$(${CAT} "$${tmpfile}"); \
case $${result} in \
REJECT) exit 1;; \
VIEW_*) name=$$(${ECHO_CMD} $${result} | ${SED} -e 's/^VIEW_//'); \
file=$$(${GREP} "^$${name}:" ${_LICENSE_ASK_DATA} | ${CUT} -d : -f 2); \
- ${DIALOG} --textbox "$${file}" 21 75 ;; \
+ ${SETENV} LC_ALL=C.UTF-8 ${DIALOG} --textbox "$${file}" 21 75 ;; \
USE_*) name=$$(${ECHO_CMD} $${result} | ${SED} -e 's/^USE_//'); \
${ECHO_CMD} $${name} > ${_LICENSE_COOKIE}; \
break ;; \
@@ -680,7 +680,7 @@ ${_LICENSE_COOKIE}:
. for lic in ${_LICENSE_TO_ASK}
@${ECHO_CMD} "${lic}:${_LICENSE_FILE_${lic}}" >> ${_LICENSE_ASK_DATA}
. endfor
- @menu_cmd="${DIALOG} --hline \"This port requires you to accept all mentioned licenses\" --menu \"License for ${PKGNAME} (multi)\" 21 70 15"; \
+ @menu_cmd="${SETENV} LC_ALL=C.UTF-8 ${DIALOG} --hline \"This port requires you to accept all mentioned licenses\" --menu \"License for ${PKGNAME} (multi)\" 21 70 15"; \
trap '${RM} $$tmpfile' EXIT INT TERM; \
tmpfile=$$(mktemp -t portlicenses); \
for lic in ${_LICENSE_TO_ASK}; do \
@@ -695,7 +695,7 @@ ${_LICENSE_COOKIE}:
REJECT) exit 1 ;; \
VIEW_*) name=$$(${ECHO_CMD} $${result} | ${SED} -e 's/^VIEW_//'); \
file=$$(${GREP} "^$${name}:" ${_LICENSE_ASK_DATA} | ${CUT} -d : -f 2); \
- ${DIALOG} --textbox "$${file}" 21 75 ;; \
+ ${SETENV} LC_ALL=C.UTF-8 ${DIALOG} --textbox "$${file}" 21 75 ;; \
esac; \
done
. endif