Skip to content

Commit 0a31df1

Browse files
crassDaniel Kiper
authored andcommitted
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>
1 parent 0dfec29 commit 0a31df1

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

INSTALL

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ configuring the GRUB.
2525
* Flex 2.5.35 or later
2626
* pkg-config
2727
* GNU patch
28+
* wget (for downloading updated translations)
2829
* Other standard GNU/Unix tools
2930
* a libc with large file support (e.g. glibc 2.1 or later)
3031

bootstrap.conf

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,16 @@ bootstrap_epilogue () {
113113
# languages.
114114
autogenerated="en@quot en@hebrew de@hebrew en@cyrillic en@greek en@arabic en@piglatin de_CH"
115115

116-
for x in $autogenerated; do
117-
rm -f "po/$x.po";
118-
done
119-
120-
(
121-
(
122-
cd po && ls *.po| cut -d. -f1
123-
for x in $autogenerated; do
124-
echo "$x";
125-
done
126-
) | sort | uniq | xargs
127-
) >po/LINGUAS
116+
{
117+
# NOTE: xargs has no POSIX compliant way to avoid running the program
118+
# given as an argument when there are no input lines. So ensure that
119+
# basename is always run with at least one argument, the empty string,
120+
# and ignore the first line of output.
121+
ls po/*.po | xargs -L 100 basename -s .po -a "" | tail -n +2
122+
for x in $autogenerated; do
123+
rm -f "po/$x.po"
124+
echo "$x"
125+
done
126+
} | sort | uniq | xargs >po/LINGUAS
128127
fi
129128
}

0 commit comments

Comments
 (0)