Files
ports/Tools/scripts/git-diff-ports.sh
T
Tijl Coosemans b6ec06f079 */*: Use C.UTF-8 locale
Ports 02f27a83b4 fixed the ports tree to the C locale so it would work
correctly in environments where users use a locale that isn't compatible
with the C locale, e.g. xx_YY.UTF-8 where [A-Z] includes more than just
upper case letters.  USE_LOCALE was introduced to let ports use another
locale if they needed it.  The C.UTF-8 locale was created later on to be
mostly compatible with the C locale.

Switch the ports tree locale to C.UTF-8 and remove USE_LOCALE.  The
world has moved to Unicode so all ports either require it or know how to
build correctly in a Unicode environment.

PR:		295945
Exp-run by:	antoine
2026-06-30 22:03:57 +02:00

35 lines
890 B
Bash
Executable File

#!/bin/sh
#
# MAINTAINER: yuri@FreeBSD.org
set -o pipefail
export LC_ALL=C.UTF-8
# ----- Dependency check ----------------------------------------------
for dep in git; do
if ! command -v "$dep" >/dev/null 2>&1; then
echo "error: the '$dep' dependency is missing"
exit 1
fi
done
# ----- Repository check -----------------------------------------------
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1 || \
! [ -f "$(git rev-parse --show-toplevel)/Mk/bsd.port.mk" ]; then
echo "error: not a FreeBSD ports repository"
exit 1
fi
# ----- Main logic -------------------------------------------------------
# Output the list of ports with uncommitted changes. If no ports are
# changed the script exits cleanly with no output.
git diff HEAD "$@" |
grep '^diff ' |
grep -v Mk |
sed -E 's|diff --git a/||; s| .*||; s|([^/]+/[^/]+).*|\1|' |
sort |
uniq || true
exit 0