Skip to content
Snippets Groups Projects
Commit 5e68a145 authored by Allan McRae's avatar Allan McRae :speech_balloon:
Browse files

limit parallel generation of locales

parent 597987fe
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@ gen() {
localedef -i "$input" -c -f "$charset" -A /usr/share/locale/locale.alias "$locale"
}
maxjobs=$(grep -qc processor /proc/cpuinfo 2>/dev/null || echo 1)
echo "Generating locales..."
while read locale charset; do \
case $locale in
......@@ -43,6 +44,12 @@ while read locale charset; do \
;;
esac
gen "$locale" "$charset" &
# keep no more than $maxjobs jobs in flight
while [ $(jobs | wc -l) -ge $maxjobs ]; do
sleep 0.25
jobs >/dev/null
done
done < $LOCALEGEN
wait
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment