-get_translations() {
- subdir=$1
- domain=$2
- po_file=$3
-
- case $WGET_COMMAND in
- '')
- echo "$0: wget not available; skipping translations";;
- ?*)
- url=`tp_url $domain`
- baseurl=`expr "$url" : '\(.*\)/.*'`
- echo "$0: getting translations into $subdir for $domain..." &&
- case $po_file in
- '') (cd $subdir && rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'`);;
- esac &&
-
- $WGET_COMMAND -O "$subdir/$domain.html" "$url" &&
-
- sed -n 's|.*href="\(.*\)/\([^/][^/]*\)/'"$domain"'-\([^/"]*\)\.[^."]*\.po".*|\2:\3:\1|p' <"$subdir/$domain.html" |
- sort -t: -k 1,1 -k 2,2n -k2,2 -k3,3n -k3,3 -k4,4n -k4,4 -k5,5n -k5.5 |
- awk -F: '
- { if (lang && $1 != lang) print lang, ver, $3 }
- { lang = $1; ver = $2 }
- END { if (lang) print lang, ver, $3 }
- ' | awk -v domain="$domain" -v baseurl="$baseurl" -v subdir="$subdir" \
- -v po_file="$po_file" '
- {
- lang = $1
- if (po_file && po_file != (lang ".po")) next
- ver = $2
- printf "{ $WGET_COMMAND -O %s/%s.po %s/%s/%s/%s-%s.%s.po &&\n", subdir, lang, baseurl, $3, lang, domain, ver, lang
- printf " msgfmt -c -o /dev/null %s/%s.po || {\n", subdir, lang
- printf " echo >&2 '\'"$0"': omitting translation for %s'\''\n", lang
- printf " rm -f %s/%s.po; }; } &&\n", subdir, lang
- }
- END { print ":" }
- ' | WGET_COMMAND="$WGET_COMMAND" sh
- ;;
- esac &&
- ls "$subdir"/*.po 2>/dev/null |
- sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" &&
- rm -f "$subdir/$domain.html"
-}
+# If $build_aux doesn't exist, create it now, otherwise some bits
+# below will malfunction. If creating it, also mark it as ignored.
+if test ! -d $build_aux; then
+ mkdir $build_aux
+ for dot_ig in x $vc_ignore; do
+ test $dot_ig = x && continue
+ insert_sorted_if_absent $dot_ig $build_aux
+ done
+fi