From de0e1f984602a7ec8f008ef2a29ca341aac1034f Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Wed, 6 Mar 2024 10:05:46 -0500 Subject: [PATCH] common/hooks/pre-pkg/99-pkglint.sh: allow C.utf8 locale in glibc package --- common/hooks/pre-pkg/99-pkglint.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh index 30d97fcda40..90cb07da3f4 100644 --- a/common/hooks/pre-pkg/99-pkglint.sh +++ b/common/hooks/pre-pkg/99-pkglint.sh @@ -79,8 +79,22 @@ hook() { # Check for l10n files in usr/lib/locale if [ -d ${PKGDESTDIR}/usr/lib/locale ]; then - msg_red "${pkgver}: /usr/lib/locale is forbidden, use /usr/share/locale!\n" - error=1 + 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