Wit reference to
And this one which sparked my investigation in glibc-locales package.
If the package is created for usage with ARM - why is it installed with x86_64?
Why is the PKGBUILD absent from the /packages/community repo on gitlab?
The comment trail of the first of above topic indicates - one could simply remove it - but that is generating error messages with locale-gen.
The glibc packages installs it’s own version of locale-gen
$ cat /usr/bin/locale-gen
#!/bin/sh
set -e
LOCALEGEN=/etc/locale.gen
LOCALES=/usr/share/i18n/locales
if [ -n "$POSIXLY_CORRECT" ]; then
unset POSIXLY_CORRECT
fi
[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0;
# Remove all old locale dir and locale-archive before generating new
# locale data.
rm -rf /usr/lib/locale/* || true
umask 022
is_entry_ok() {
if [ -n "$locale" -a -n "$charset" ] ; then
true
else
echo "error: Bad entry '$locale $charset'"
false
fi
}
echo "Generating locales..."
while read locale charset; do \
case $locale in \#*) continue;; "") continue;; esac; \
is_entry_ok || continue
echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`"; \
echo -n ".$charset"; \
echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'`; \
echo -n '...'; \
if [ -f $LOCALES/$locale ]; then input=$locale; else \
input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; fi; \
localedef -i $input -c -f $charset -A /usr/share/locale/locale.alias $locale; \
echo ' done'; \
done < $LOCALEGEN
echo "Generation complete."
echo "Copying saved locales..."
cp -a /usr/lib/glibc-locale/* /usr/lib/locale/
echo "Copying complete."
overwrites the original locale-gen script without any backup
post_install() {
cp -a /usr/lib/glibc-locale/*utf8 /usr/lib/locale/
cp -a /usr/lib/glibc-locale/locale-gen /usr/bin/locale-gen
}
The unnecessary set of locales is the copied thus ending up taken around 400MB disk space - also on the ISO
$ cat /usr/share/libalpm/60-glibc-locales.hook
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Target = usr/lib/locale/*
[Action]
Description = Restoring locales
When = PostTransaction
Exec = /bin/bash -c 'cp -a /usr/lib/glibc-locale/*utf8 /usr/lib/locale/'
If locale is updated the script is replaced
$ cat /usr/share/libalpm/locale-gen.hook
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = glibc
[Action]
Description = Modifying 'locale-gen'
When = PostTransaction
Depends = glibc
Exec = /bin/bash -c 'cp -a /usr/lib/glibc-locale/locale-gen /usr/bin'
When on uninstall the package from an x86_64 system the original locale-gen script cannot be restored - thus generating errors when running locale-gen script
$ sudo locale-gen
Generating locales...
da_DK.UTF-8... done
en_DK.UTF-8... done
en_US.UTF-8... done
Generation complete.
Copying saved locales...
cp: cannot stat '/usr/lib/glibc-locale/*': No such file or directory
The package also creates confusion about the state of the locale as can be seen from topic number two linked above.
I think this warrants the package removed from community repo and removed from the ISO profile(s) as this would also cut 400MB from the ISO.
On a side note to the above - even the minimal Xfce ISO is at 3G - is that really necessary?