bootstrap: Condense and simplify LINGUAS generation

Remove unnecessary subshells. Loop over autogenerated po files only once.
Use existing LINGUAS created by bootstrap instead of finding po files
again.

Add wget as a soft requirement now that we are using bootstrap's code
for updating translation files. This should only be needed if updated
translations are desired, which is the default. There should be older
translation files already, and wget is not necessary if those will
suffice.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Glenn Washburn 2025-11-20 12:56:47 -06:00 committed by Daniel Kiper
parent 0dfec2945a
commit 0a31df119d
2 changed files with 12 additions and 12 deletions

View File

@ -25,6 +25,7 @@ configuring the GRUB.
* Flex 2.5.35 or later * Flex 2.5.35 or later
* pkg-config * pkg-config
* GNU patch * GNU patch
* wget (for downloading updated translations)
* Other standard GNU/Unix tools * Other standard GNU/Unix tools
* a libc with large file support (e.g. glibc 2.1 or later) * a libc with large file support (e.g. glibc 2.1 or later)

View File

@ -113,17 +113,16 @@ bootstrap_epilogue () {
# languages. # languages.
autogenerated="en@quot en@hebrew de@hebrew en@cyrillic en@greek en@arabic en@piglatin de_CH" autogenerated="en@quot en@hebrew de@hebrew en@cyrillic en@greek en@arabic en@piglatin de_CH"
{
# NOTE: xargs has no POSIX compliant way to avoid running the program
# given as an argument when there are no input lines. So ensure that
# basename is always run with at least one argument, the empty string,
# and ignore the first line of output.
ls po/*.po | xargs -L 100 basename -s .po -a "" | tail -n +2
for x in $autogenerated; do for x in $autogenerated; do
rm -f "po/$x.po"; rm -f "po/$x.po"
echo "$x"
done done
} | sort | uniq | xargs >po/LINGUAS
(
(
cd po && ls *.po| cut -d. -f1
for x in $autogenerated; do
echo "$x";
done
) | sort | uniq | xargs
) >po/LINGUAS
fi fi
} }