common/hooks/pre-pkg/99-pkglint.sh: allow C.utf8 locale in glibc package

This commit is contained in:
Andrew J. Hesford 2024-03-06 10:05:46 -05:00
parent a4294cdf8c
commit de0e1f9846
1 changed files with 16 additions and 2 deletions

View File

@ -79,9 +79,23 @@ hook() {
# Check for l10n files in usr/lib/locale
if [ -d ${PKGDESTDIR}/usr/lib/locale ]; then
local locale_allow=0 ldir
local lroot="${PKGDESTDIR}/usr/lib/locale"
if [ "${pkgname}" = "glibc" ]; then
# glibc gets an exception for its included C.utf8 locale
locale_allow=1
for ldir in "${lroot}"/*; do
[ "${ldir}" = "${lroot}/C.utf8" ] && continue
locale_allow=0
done
fi
if [ "${locale_allow}" -ne 1 ]; then
msg_red "${pkgver}: /usr/lib/locale is forbidden, use /usr/share/locale!\n"
error=1
fi
fi
# Check for bash completions in etc/bash_completion.d
# should be on usr/share/bash-completion/completions